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

---
 src/store/modules/user/index.ts |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/src/store/modules/user/index.ts b/src/store/modules/user/index.ts
index 047dcc1..84388d7 100644
--- a/src/store/modules/user/index.ts
+++ b/src/store/modules/user/index.ts
@@ -81,7 +81,13 @@
         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) {

--
Gitblit v1.8.0