diff --git a/src/utils/axios/index.ts b/src/utils/axios/index.ts index df63fa0..99a51b7 100644 --- a/src/utils/axios/index.ts +++ b/src/utils/axios/index.ts @@ -27,13 +27,13 @@ service.interceptors.request.use((config: InternalAxiosRequestConfig) => { config.headers["user-token"] = userPinia.userToken; } - console.error('<---------------请求拦截---------->') - console.error('请求拦截----config------>', config.url) - console.error('请求拦截----data------>', config.data) - console.error('<---------------请求拦截---------->') - // if (config.headers['content-type'] === 'application/json') { + // console.error('<---------------请求拦截---------->') + // console.error('请求拦截----config------>', config.url) + // console.error('请求拦截----data------>', config) + // console.error('<---------------请求拦截---------->') + // // if (config.headers['content-type'] === 'application/json') { let { data, headers } = config - //获取16位随机数 + // //获取16位随机数 let randomString = generateRandomString(16) config.headers['Auth-key'] = randomString if (data) { @@ -61,8 +61,8 @@ service.interceptors.response.use((response: AxiosResponse) => { let jsonData = sm4DecryptMethod(data.data, authKey) response.data.data = JSON.parse(jsonData) } - console.error('行营结果----解密结构------>', response.config.url) - console.error('行营结果----解密结构------>', response.data) + // console.error('行营结果----解密结构------>', response.config.url) + // console.error('行营结果----解密结构------>', response.data) // 对响应数据做点什么 const { code, msg } = response.data; //如果是以下状态直接放行 diff --git a/src/utils/encryptionAndDecryption/sm4Utils.ts b/src/utils/encryptionAndDecryption/sm4Utils.ts index 4a764e6..6349f30 100644 --- a/src/utils/encryptionAndDecryption/sm4Utils.ts +++ b/src/utils/encryptionAndDecryption/sm4Utils.ts @@ -59,10 +59,10 @@ const sm4DecryptMethod = (data: string, customKey: string): string => { } } // console.log('SM4解密方法----解密结构---data--->', data) - console.log('SM4解密方法----解密结构----customKey-->', customKey) - console.log('SM4解密方法----解密结构--ivSetup---->', ivSetup) - console.log('SM4解密方法----解密结构---sm4TokenKey--->', sm4TokenKey) - console.log('SM4解密方法----解密结构---appSystemKey--->', appSystemKey) + // console.log('SM4解密方法----解密结构----customKey-->', customKey) + // console.log('SM4解密方法----解密结构--ivSetup---->', ivSetup) + // console.log('SM4解密方法----解密结构---sm4TokenKey--->', sm4TokenKey) + // console.log('SM4解密方法----解密结构---appSystemKey--->', appSystemKey) return sm4.decrypt(data, appSystemKey, { iv: ivSetup, mode: sm4.constants.CBC, diff --git a/src/utils/pinia/stores/modules/userOrders.ts b/src/utils/pinia/stores/modules/userOrders.ts index f198e97..2b24149 100644 --- a/src/utils/pinia/stores/modules/userOrders.ts +++ b/src/utils/pinia/stores/modules/userOrders.ts @@ -110,7 +110,7 @@ export const userStror = defineStore("user",() => { return new Promise((resolve, reject) => { getUserInfoIng() .then((data:any)=>{ - // console.log("获取用户信息:角色必须是非null数组!",data); + console.log("获取用户信息:角色必须是非null数组!",data); nickname.value = data.data.nickname; avatar.value = data.data.avatar; roles.value = data.data.roles; diff --git a/vite.config.ts b/vite.config.ts index f60c52c..614f266 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -71,6 +71,15 @@ export default defineConfig(({ mode }: ConfigEnv): UserConfig => { autoInstall: true, }), ], + build: { + minify: 'terser', + terserOptions: { + compress: { + drop_console: true, // 删除所有 console 语句 + drop_debugger: true // 删除所有 debugger 语句 + } + } + } } })