|
|
@@ -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) {
|