From c02bff2911f720d54388f4abb6456ec1777f8a96 Mon Sep 17 00:00:00 2001
From: zhangxiao <898441624@qq.com>
Date: 星期五, 30 八月 2024 10:40:02 +0800
Subject: [PATCH] fix: 修改bug

---
 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 56d90b8..84388d7 100644
--- a/src/store/modules/user/index.ts
+++ b/src/store/modules/user/index.ts
@@ -81,11 +81,18 @@
         this.name=res.data.userName
      
         if(res.data?.roles.length>0)
-            this.resources=res.data.roles[0].resources;
+          //閬嶅巻roles
+          for (const r of res.data.roles) {
+            if (!(this.resources)) {
+              this.resources = [];
+            }
+            this.resources = this.resources.concat(r.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