src/store/modules/user/index.ts
@@ -75,8 +75,10 @@ avatar: res.data.avatar, name: res.data.nickname, email: res.data.email, role: res.data.roles[0].roleKey, }; 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))