From 88e5392abfba200898c93e0d1d24f7454baaf921 Mon Sep 17 00:00:00 2001
From: liudong <liudong>
Date: 星期五, 16 八月 2024 13:54:17 +0800
Subject: [PATCH] 新版UI对话页面开发
---
src/store/modules/user/index.ts | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/src/store/modules/user/index.ts b/src/store/modules/user/index.ts
index 51faef3..7bb51c3 100644
--- a/src/store/modules/user/index.ts
+++ b/src/store/modules/user/index.ts
@@ -9,6 +9,7 @@
import { removeRouteListener } from '@/utils/route-listener';
import { UserState } from './types';
import useAppStore from '../app';
+import router from "@/router";
const useUserStore = defineStore('user', {
@@ -75,7 +76,10 @@
name: res.data.nickname,
email: res.data.email,
};
- this.resources=res.data.resources;
+ if(res.data.roles && res.data.roles.length>0)
+ this.resources=res.data.roles[0].resources;
+ else
+ this.resources=res.data.resources;
setUserInfo(JSON.stringify(userInfo));
setUserResources(JSON.stringify(this.resources))
for (const r of this.resources) {
@@ -100,6 +104,9 @@
try {
await userLogout();
} finally {
+ router.push({
+ name: "login",
+ });
this.logoutCallBack();
}
},
--
Gitblit v1.8.0