From c832bf2e80ac465e71b7a1c1f7a59d4252030989 Mon Sep 17 00:00:00 2001
From: 张含笑 <zhx18749296735@163.com>
Date: Tue, 05 Aug 2025 17:33:08 +0800
Subject: [PATCH] feat:事件工单滚动条
---
src/store/modules/user.js | 20 ++++++++++++++++++--
1 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/src/store/modules/user.js b/src/store/modules/user.js
index 3b6a410..2750ef4 100644
--- a/src/store/modules/user.js
+++ b/src/store/modules/user.js
@@ -27,6 +27,7 @@
import { encrypt } from '@/utils/sm2';
import md5 from 'js-md5';
+
const user = {
state: {
tenantId: getStore({ name: 'tenantId' }) || '',
@@ -39,7 +40,7 @@
token: getStore({ name: 'token' }) || '',
refreshToken: getStore({ name: 'refreshToken' }) || '',
parentDeptInfo: getStore({ name: 'parentDeptInfo' }) || '',
-
+
},
actions: {
//根据用户名登录
@@ -269,16 +270,31 @@
});
},
GetMenu({ commit, dispatch }, tenantId) {
+ const errLogOut = () => {
+ dispatch('LogOut').then(()=>{
+ const env = import.meta.env.VITE_APP_ENV
+ const adminUrl = import.meta.env.VITE_APP_DASHBOARD_URL
+ env === 'development'
+ ? window.location.href = "/manage/login"
+ : window.location.replace(`${adminUrl}#/login`)
+ })
+ }
return new Promise(resolve => {
getRoutes(tenantId).then(res => {
const data = res.data.data;
let menu = deepClone(data);
+ if (!res.data?.data?.length){
+ errLogOut()
+ return
+ }
menu.forEach(ele => formatPath(ele, true));
commit('SET_MENU', menu);
commit('SET_MENU_ALL', menu);
dispatch('GetButtons');
resolve(menu);
- });
+ }).catch(err =>{
+ errLogOut()
+ })
});
},
GetButtons({ commit }) {
--
Gitblit v1.9.3