菜单页面需等用户接口获取之后再调用
Showing
1 changed file
with
9 additions
and
9 deletions
| ... | @@ -55,24 +55,24 @@ const useUserStore = defineStore( | ... | @@ -55,24 +55,24 @@ const useUserStore = defineStore( |
| 55 | currentTenantGuid.value = res.data.tenantInfoList && res.data.tenantInfoList.length ? res.data.tenantInfoList[0].guid : ''; | 55 | currentTenantGuid.value = res.data.tenantInfoList && res.data.tenantInfoList.length ? res.data.tenantInfoList[0].guid : ''; |
| 56 | localStorage.setItem('currentTenantGuid', currentTenantGuid.value); | 56 | localStorage.setItem('currentTenantGuid', currentTenantGuid.value); |
| 57 | let currentTenant = res.data.tenantInfoList?.[0]; | 57 | let currentTenant = res.data.tenantInfoList?.[0]; |
| 58 | getCurrentUserInfo({tenantGuid: currentTenantGuid.value}).then((res: any) => { | 58 | return getCurrentUserInfo({tenantGuid: currentTenantGuid.value}).then((res: any) => { |
| 59 | console.log(res, 'getCurrentUserInfo'); | 59 | console.log(res, 'getCurrentUserInfo'); |
| 60 | if (res.code == '00000') { | 60 | if (res.code == '00000') { |
| 61 | userName.value = res.data.staffName; | 61 | userName.value = res.data.staffName; |
| 62 | localStorage.setItem('userName', res.data?.staffName); | 62 | localStorage.setItem('userName', res.data?.staffName); |
| 63 | localStorage.setItem('userData', JSON.stringify(res.data)); | 63 | localStorage.setItem('userData', JSON.stringify(res.data)); |
| 64 | return getSystemMenu({ tenantGuid: currentTenantGuid.value }).then((info: any) => { //解决页面调用流程接口传递staffGuid,为空的问题 | ||
| 65 | if (info.code == '00000') { | ||
| 66 | localStorage.setItem('userInfoData', JSON.stringify(info.data)); | ||
| 67 | userInfoData.value = info.data; | ||
| 68 | } else { | ||
| 69 | ElMessage.error(info.msg) | ||
| 70 | } | ||
| 71 | }) | ||
| 64 | } else { | 72 | } else { |
| 65 | ElMessage.error(res.msg) | 73 | ElMessage.error(res.msg) |
| 66 | } | 74 | } |
| 67 | }) | 75 | }) |
| 68 | return getSystemMenu({ tenantGuid: currentTenantGuid.value }).then((info: any) => { | ||
| 69 | if (info.code == '00000') { | ||
| 70 | localStorage.setItem('userInfoData', JSON.stringify(info.data)); | ||
| 71 | userInfoData.value = info.data; | ||
| 72 | } else { | ||
| 73 | ElMessage.error(info.msg) | ||
| 74 | } | ||
| 75 | }) | ||
| 76 | } else { | 76 | } else { |
| 77 | isLogin.value = false; | 77 | isLogin.value = false; |
| 78 | // ElMessage.error(res.msg);//授权码被重复使用,不抛出异常。 | 78 | // ElMessage.error(res.msg);//授权码被重复使用,不抛出异常。 | ... | ... |
-
Please register or sign in to post a comment