zhangxiao
2024-08-29 7a0e574e65db50882a1d118e285b138c7831a7a8
src/store/modules/user/index.ts
@@ -71,11 +71,14 @@
        const res = await userLogin(loginForm);
        setToken(res.data.access_token);
        const userInfo = {
          avatar: res.data.avatar,
          name: res.data.nickname,
          name: res.data.userName,
          email: res.data.email,
          role: res.data.roles[0].roleKey,
        };
        this.name=res.data.userName
     
        if(res.data?.roles.length>0)
            this.resources=res.data.roles[0].resources;
@@ -83,6 +86,7 @@
            setUserResources(JSON.stringify(this.resources))
        for (const r of this.resources) {
          if (r.menuType == 0) {
            return r.component
          }
        }