222版,适应签名sdk

This commit is contained in:
yy2205 2025-06-18 10:08:28 +08:00
parent 4cb3300cf5
commit 64d10aa51c
3 changed files with 42 additions and 14 deletions

View File

@ -11,7 +11,6 @@ import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import { ElementPlusResolver } from 'unplugin-vue-components/resolvers'
import viteCompression from 'vite-plugin-compression'
import topLevelAwait from 'vite-plugin-top-level-await'
import VueI18nPlugin from '@intlify/unplugin-vue-i18n/vite'
import { createSvgIconsPlugin } from 'vite-plugin-svg-icons'
import UnoCSS from 'unocss/vite'
@ -88,13 +87,6 @@ export function createVitePlugins() {
ext: '.gz', // 生成的压缩包后缀
deleteOriginFile: false //压缩后是否删除源文件
}),
ViteEjsPlugin(),
topLevelAwait({
// https://juejin.cn/post/7152191742513512485
// The export name of top-level await promise for each chunk module
promiseExportName: '__tla',
// The function to generate import names of top-level await promise in each chunk module
promiseImportName: (i) => `__tla_${i}`
})
ViteEjsPlugin()
]
}

View File

@ -4,7 +4,12 @@ import { TableColumn } from '@/types/table'
import * as MailAccountApi from '@/api/system/mail/account'
// 邮箱账号的列表
const accountList = await MailAccountApi.getSimpleMailAccountList()
let accountList: any[] = []
// 初始化账号列表
const initAccountList = async () => {
accountList = await MailAccountApi.getSimpleMailAccountList()
}
// 表单校验
export const rules = reactive({
@ -54,7 +59,12 @@ const crudSchemas = reactive<CrudSchema[]>([
search: {
show: true,
component: 'Select',
api: () => accountList,
api: async () => {
if (accountList.length === 0) {
await initAccountList()
}
return accountList
},
componentProps: {
optionsAlias: {
labelField: 'mail',
@ -64,7 +74,12 @@ const crudSchemas = reactive<CrudSchema[]>([
},
form: {
component: 'Select',
api: () => accountList,
api: async () => {
if (accountList.length === 0) {
await initAccountList()
}
return accountList
},
componentProps: {
optionsAlias: {
labelField: 'mail',

View File

@ -65,7 +65,16 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
minify: 'terser',
outDir: env.VITE_OUT_DIR || 'dist',
sourcemap: env.VITE_SOURCEMAP === 'true' ? 'inline' : false,
// brotliSize: false,
chunkSizeWarningLimit: 1500,
rollupOptions: {
output: {
manualChunks: {
'element-plus': ['element-plus'],
'vue-vendor': ['vue', 'vue-router', 'pinia'],
'echarts': ['echarts', 'echarts-wordcloud']
}
}
},
terserOptions: {
compress: {
drop_debugger: env.VITE_DROP_DEBUGGER === 'true',
@ -73,6 +82,18 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
}
}
},
optimizeDeps: { include, exclude }
optimizeDeps: {
include,
exclude,
esbuildOptions: {
target: 'es2020'
}
},
// 添加对 SDK 文件的特殊处理
define: {
'process.env': {},
'global': 'window',
'require': 'window.require'
}
}
}