From 176b1538bb80fc65539f004a7ccbae94b7d8eafc Mon Sep 17 00:00:00 2001 From: liudong <liudong> Date: 星期三, 21 八月 2024 16:18:30 +0800 Subject: [PATCH] 智能体详情信息 --- src/store/modules/user/index.ts | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/store/modules/user/index.ts b/src/store/modules/user/index.ts index 1ee0211..4c508a2 100644 --- a/src/store/modules/user/index.ts +++ b/src/store/modules/user/index.ts @@ -76,10 +76,11 @@ name: res.data.nickname, email: res.data.email, }; - if(res.data.roles && res.data.roles.length>0) + + if(res.data?.roles.length>0) this.resources=res.data.roles[0].resources; - setUserInfo(JSON.stringify(userInfo)); - setUserResources(JSON.stringify(this.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