瀏覽代碼

[Mod 0000] 局部风机评价分析设置是否显示配置

hongrunxia 1 月之前
父節點
當前提交
61e43be1b1

+ 1 - 0
src/hooks/vent/useAutoLogin.ts

@@ -75,6 +75,7 @@ export function useAutoLogin() {
     }
   }
 
+  // token 登录
   async function doTokenLogin(token: string) {
     const res = await tokenLogin({ token });
     userStore.setUserInfo(res['userInfo']);

+ 6 - 0
src/settings/encryptionSetting.ts

@@ -9,5 +9,11 @@ export const cacheCipher = {
   iv: '@11111000001111_',
 };
 
+// 开启登录密码加密,采用aes加密
+export const loginCipher = {
+  key: '_11111000001111@',
+  iv: '@11111000001111_',
+};
+
 // 是否加密缓存,默认生产环境加密
 export const enableStorageEncryption = !isDevMode();

+ 9 - 0
src/store/modules/user.ts

@@ -20,6 +20,8 @@ import { RoleEnum } from '/@/enums/roleEnum';
 import { useSso } from '/@/hooks/web/useSso';
 import { getActions } from '/@/qiankun/state';
 import { MOCK_LOGIN_PASSWORD, MOCK_LOGIN_UESRNAME } from '../constant';
+import { AesEncryption } from '/@/utils/cipher';
+import { loginCipher } from '/@/settings/encryptionSetting';
 
 interface UserState {
   userInfo: Nullable<UserInfo>;
@@ -146,6 +148,9 @@ export const useUserStore = defineStore({
     ): Promise<GetUserInfoModel | null> {
       try {
         const { goHome = true, mode, successMode, ...loginParams } = params;
+        // 进行加密
+        const encryption = new AesEncryption({ key: loginCipher.key, iv: loginCipher.iv });
+        // loginParams.password = encryption.encryptByAES(loginParams.password);
         const data = await loginApi(loginParams, mode, successMode);
         const { token, userInfo } = data;
         // save token
@@ -401,6 +406,7 @@ export const useUserStore = defineStore({
       });
       router.go(0);
     },
+
     /** 用户自动登录,即不需要用户密码即可登录 */
     async autoLogin(
       params: AutoLoginParams & {
@@ -410,6 +416,9 @@ export const useUserStore = defineStore({
       }
     ) {
       const { goHome = true, mode, successMode = 'none', ...loginParams } = params;
+      // 进行加密
+      // const encryption = new AesEncryption({ key: loginCipher.key, iv: loginCipher.iv });
+      // loginParams.password = encryption.encryptByAES(loginParams.password);
       const data = await autoLoginApi(loginParams, mode, successMode);
       const { token, userInfo } = data;
       // save token

File diff suppressed because it is too large
+ 664 - 615
src/views/vent/monitorManager/fanLocalMonitor/index.vue


Some files were not shown because too many files changed in this diff