From c7ff3b73e5a42e6adc923c72b118b3134daf58ed Mon Sep 17 00:00:00 2001 From: zhangxiao <898441624@qq.com> Date: 星期四, 29 八月 2024 09:34:46 +0800 Subject: [PATCH] Merge branch 'master' of http://192.168.5.5:10010/r/web/flow_web --- src/store/modules/user/index.ts | 14 ++++++++++---- 1 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/store/modules/user/index.ts b/src/store/modules/user/index.ts index faa226d..047dcc1 100644 --- a/src/store/modules/user/index.ts +++ b/src/store/modules/user/index.ts @@ -71,16 +71,22 @@ 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.resources=res.data.resources; - setUserInfo(JSON.stringify(userInfo)); - setUserResources(JSON.stringify(this.resources)) + this.name=res.data.userName + + if(res.data?.roles.length>0) + this.resources=res.data.roles[0].resources; + setUserInfo(JSON.stringify(userInfo)); + setUserResources(JSON.stringify(this.resources)) for (const r of this.resources) { if (r.menuType == 0) { + return r.component } } -- Gitblit v1.8.0