Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
corporate-culture-qd
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王立鹏
corporate-culture-qd
Commits
5b376bbf
Commit
5b376bbf
authored
Apr 29, 2026
by
王立鹏
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '优化/打包优化' into 'master'
优化/打包优化 See merge request
!24
parents
a1251cdc
5b1e8736
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
11 additions
and
36 deletions
+11
-36
index.ts
src/api/common/index.ts
+2
-2
index.ts
src/utils/excel/index.ts
+3
-2
index.ts
src/utils/md5/index.ts
+0
-30
vite.config.ts
vite.config.ts
+6
-2
No files found.
src/api/common/index.ts
View file @
5b376bbf
...
...
@@ -4,8 +4,8 @@ import { useUserStore } from '@/stores'
import
{
storeToRefs
}
from
'pinia'
import
type
{
UploadFileResponseItem
,
ChunkCheckResponse
}
from
'./types'
const
OA_UPLOAD_CHUNK_BASE_URL
=
'http
s://oa.yswg.com.cn:8085
'
// 'https://oa.yswg.com.cn:8085'
const
OA_UPLOAD_CHUNK_BASE_URL
=
'http
://nas1.yswg.top:8088
'
const
OA_UPLOAD_COMMON_BASE_URL
=
'http://47.112.96.71:8082'
const
CHUNK_UPLOAD_THRESHOLD
=
10
*
1024
*
1024
const
CHUNK_SIZE
=
5
*
1024
*
1024
...
...
src/utils/excel/index.ts
View file @
5b376bbf
import
*
as
XLSX
from
'xlsx'
import
{
push
}
from
'notivue'
/**
* 导出 Excel
...
...
@@ -21,13 +20,15 @@ export interface ExportOptions<T> {
sheetName
?:
string
}
export
function
exportExcel
<
T
>
({
export
async
function
exportExcel
<
T
>
({
data
,
columns
,
fileName
=
'导出数据'
,
sheetName
=
'Sheet1'
,
}:
ExportOptions
<
T
>
)
{
if
(
!
data
||
!
data
.
length
)
return
push
.
warning
(
'没有可导出的数据'
)
// 文件比较大 切非首屏加载 可以选择动态引入 避免首屏加载过慢
const
XLSX
=
await
import
(
'xlsx'
)
const
header
=
columns
.
map
((
col
)
=>
col
.
title
)
...
...
src/utils/md5/index.ts
deleted
100644 → 0
View file @
a1251cdc
import
CryptoJS
from
'crypto-js'
/**
* 使用 MD5 加密字符串
* @param input - 要加密的字符串
* @returns 加密后的 MD5 字符串
*/
export
function
md5Hash
(
input
:
string
):
string
{
return
CryptoJS
.
MD5
(
input
).
toString
()
}
/**
* AES 加密方法
* @param plaintext 要加密的明文
* @param key 密钥 (16, 24 或 32 字节长度的字符串)
* @returns 加密后的字符串
*/
export
function
aesEncrypt
(
plaintext
:
string
,
key
:
string
):
string
{
if
(
!
[
16
,
24
,
32
].
includes
(
key
.
length
))
{
throw
new
Error
(
'秘钥长度必须为 16, 24 或 32 字节。'
)
}
// 加密数据
const
encrypted
=
CryptoJS
.
AES
.
encrypt
(
plaintext
,
CryptoJS
.
enc
.
Utf8
.
parse
(
key
),
{
mode
:
CryptoJS
.
mode
.
ECB
,
padding
:
CryptoJS
.
pad
.
Pkcs7
,
})
return
encrypted
.
toString
()
}
vite.config.ts
View file @
5b376bbf
...
...
@@ -82,7 +82,8 @@ export default defineConfig(({ mode }) => {
// },
},
build
:
{
minify
:
true
,
// 'esbuild'
minify
:
true
,
// minify: false,
chunkSizeWarningLimit
:
1000
,
rollupOptions
:
{
output
:
{
...
...
@@ -90,9 +91,12 @@ export default defineConfig(({ mode }) => {
chunkFileNames
:
'assets/js/[name]-[hash].js'
,
codeSplitting
:
{
groups
:
[
{
name
:
'elementPlus-vendor'
,
test
:
/node_modules
[\\/]
element-plus/
,
priority
:
9
},
{
name
:
'vue-vendor'
,
test
:
/node_modules
[\\/]
vue/
,
priority
:
10
},
{
name
:
'elementPlus-vendor'
,
test
:
/node_modules
[\\/]
element-plus/
,
priority
:
9
},
{
name
:
'wangeditor-vendor'
,
test
:
/node_modules
[\\/]
@wangeditor/
,
priority
:
8
},
{
name
:
'xlsx-vendor'
,
test
:
/node_modules
[\\/]
xlsx/
,
priority
:
7
},
{
name
:
'crypto-js-vendor'
,
test
:
/node_modules
[\\/]
crypto-js/
,
priority
:
6
},
{
name
:
'vue-use-vendor'
,
test
:
/node_modules
[\\/]
@vueuse/
,
priority
:
5
},
{
name
:
'common'
,
minShareCount
:
2
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment