Explorar el Código

开启参数加密

lifanagju_citu hace 6 meses
padre
commit
69548e23f2
Se han modificado 2 ficheros con 3 adiciones y 3 borrados
  1. 0 1
      api/sign.js
  2. 3 2
      utils/request.js

+ 0 - 1
api/sign.js

@@ -68,7 +68,6 @@ export const getUserAccount = () => {
     url: '/app-api/menduner/system/mde-user/get/account',
     method: 'GET',
     custom: {
-      openEncryption: true,
       showLoading: false,
       auth: true
     }

+ 3 - 2
utils/request.js

@@ -10,7 +10,7 @@ import { baseUrl, tenantId, apiPath } from './config'
 import { showAuthModal } from '@/hooks/useModal'
 import { rewardEventTrackClick } from '@/api/integral'
 import { getSuffixAfterPrefix } from '@/utils/prefixUrl'
-// import { encryptionFun } from '@/utils/openEncryption'
+import { encryptionFun } from '@/utils/openEncryption'
 
 import qs from 'qs'
 
@@ -116,7 +116,7 @@ http.interceptors.request.use(
 		}
 
     // 开启参数加密
-    // if (config.custom?.openEncryption) encryptionFun(config)
+    if (config.custom?.openEncryption) encryptionFun(config)
 
     // 增加 token 令牌、terminal 终端、tenant 租户的请求头
 		const token = getAccessToken();
@@ -162,6 +162,7 @@ http.interceptors.request.use(
  */
 http.interceptors.response.use(
 	(response) => {
+		// console.log(1, 'response', response)
 		// 约定:如果是 /auth/ 下的 URL 地址,并且返回了 accessToken 说明是登录相关的接口,则自动设置登陆令牌
 		if (response.config.url.indexOf('/system/auth/') >= 0 && response.data?.data?.accessToken) {
 			const useUserStore = userStore()