Browse Source

1. 编写自动登录功能
2. 主风机加指令下发提示

hongrunxia 1 day ago
parent
commit
7585a63076

+ 2 - 0
src/api/sys/model/userModel.ts

@@ -55,6 +55,8 @@ export interface GetUserInfoModel {
   userInfo?: any;
   // 缓存字典项
   sysAllDictItems?: any;
+  // token
+  token?: string;
 }
 
 /**

+ 1 - 1
src/api/sys/user.ts

@@ -96,7 +96,7 @@ export function phoneLoginApi(params: LoginParams, mode: ErrorMessageMode = 'mod
 }
 
 export function tokenLogin(params: TokenInfo, mode: ErrorMessageMode = 'modal') {
-  return defHttp.get<LoginResultModel>(
+  return defHttp.get<GetUserInfoModel>(
     {
       url: Api.tokenLogin,
       headers: {

+ 6 - 6
src/hooks/vent/useAutoLogin.ts

@@ -4,7 +4,9 @@ import { RouteLocationNormalized } from 'vue-router';
 import { useMessage } from '../web/useMessage';
 import { AUTO_LOGIN_URL_QUERY } from '/@/router/constant';
 import { AxiosError } from 'axios';
-import { tokenLogin } from '/@/api/sys/user';
+import { tokenLogin, getUserInfo } from '/@/api/sys/user';
+import { isArray } from '/@/utils/is';
+import { RoleEnum } from '/@/enums/roleEnum';
 
 /** 自动登录功能的Hook,该Hook是为了部署在同一局域网内的多套系统之间能够无缝切换 */
 export function useAutoLogin() {
@@ -74,11 +76,9 @@ export function useAutoLogin() {
   }
 
   async function doTokenLogin(token: string) {
-    const res = await tokenLogin({ token });
-    if (res['success']) {
-      userStore.setToken(token);
-      userStore.setUserInfo(res['']);
-    }
+    await tokenLogin({ token });
+    userStore.setToken(token);
+    await userStore.getUserInfoAction();
   }
 
   return {

+ 1 - 0
src/views/vent/monitorManager/mainFanMonitor/index.vue

@@ -1410,6 +1410,7 @@
             createMessage.error(err.message);
           });
       }
+      modalIsShow.value = false;
     };
   };
 

+ 2 - 2
src/views/vent/monitorManager/windowMonitor/window.threejs.ts

@@ -225,8 +225,8 @@ export const setModelType = (type) => {
 };
 
 export const mountedThree = (playerDom) => {
-  // const { sysOrgCode } = useGlobSetting();
-  const sysOrgCode = 'sdmtjtswmk';
+  const { sysOrgCode } = useGlobSetting();
+  // const sysOrgCode = 'sdmtjtswmk';
   return new Promise(async (resolve) => {
     model = new UseThree('#window3D');
     if (!model || !model.renderer || !model.camera) return;