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