yinbangzhong %!s(int64=2) %!d(string=hai) anos
pai
achega
30c1eeca00
Modificáronse 2 ficheiros con 8 adicións e 2 borrados
  1. 7 1
      src/store/modules/user/index.ts
  2. 1 1
      src/views/dmx/knowledgeLib/config.vue

+ 7 - 1
src/store/modules/user/index.ts

@@ -81,7 +81,13 @@ const useUserStore = defineStore('user', {
         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) {

+ 1 - 1
src/views/dmx/knowledgeLib/config.vue

@@ -362,7 +362,7 @@ const changekbObj = (value) => {
       description: kbObj.description,
       language: "English",
       permission: kbObj.permission,
-      embd_id: props.kbtenantInfo.embd_id || kbObj.embd_id,
+      embd_id: kbObj.embd_id || props.kbtenantInfo.embd_id,
       parser_id: kbObj.parser_id,
       layout_recognize: true,
     }