From 3c8070e9f97b42a56564b180bbecf5e54d7709ca Mon Sep 17 00:00:00 2001 From: yinbangzhong <zhongbangyin@126.com> Date: 星期四, 22 八月 2024 16:44:27 +0800 Subject: [PATCH] role --- src/store/modules/user/index.ts | 8 +++++--- 1 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/store/modules/user/index.ts b/src/store/modules/user/index.ts index faa226d..4c508a2 100644 --- a/src/store/modules/user/index.ts +++ b/src/store/modules/user/index.ts @@ -76,9 +76,11 @@ name: res.data.nickname, email: res.data.email, }; - this.resources=res.data.resources; - setUserInfo(JSON.stringify(userInfo)); - setUserResources(JSON.stringify(this.resources)) + + if(res.data?.roles.length>0) + this.resources=res.data.roles[0].resources; + setUserInfo(JSON.stringify(userInfo)); + setUserResources(JSON.stringify(this.resources)) for (const r of this.resources) { if (r.menuType == 0) { return r.component -- Gitblit v1.8.0