d3b04ac1 by lihua

菜单页面需等用户接口获取之后再调用

1 parent 67f5a5df
......@@ -54,24 +54,24 @@ const useUserStore = defineStore(
currentTenantGuid.value = res.data.tenantInfoList && res.data.tenantInfoList.length ? res.data.tenantInfoList[0].guid : '';
localStorage.setItem('currentTenantGuid', currentTenantGuid.value);
let currentTenant = res.data.tenantInfoList?.[0];
getCurrentUserInfo({tenantGuid: currentTenantGuid.value}).then((res: any) => {
return getCurrentUserInfo({tenantGuid: currentTenantGuid.value}).then((res: any) => {
console.log(res, 'getCurrentUserInfo');
if (res.code == '00000') {
userName.value = res.data.staffName;
localStorage.setItem('userName', res.data?.staffName);
localStorage.setItem('userData', JSON.stringify(res.data));
return getSystemMenu({ tenantGuid: currentTenantGuid.value }).then((info: any) => { //解决页面调用流程接口传递staffGuid,为空的问题
if (info.code == '00000') {
localStorage.setItem('userInfoData', JSON.stringify(info.data));
userInfoData.value = info.data;
} else {
ElMessage.error(info.msg)
}
})
} else {
ElMessage.error(res.msg)
}
})
return getSystemMenu({ tenantGuid: currentTenantGuid.value }).then((info: any) => {
if (info.code == '00000') {
localStorage.setItem('userInfoData', JSON.stringify(info.data));
userInfoData.value = info.data;
} else {
ElMessage.error(info.msg)
}
})
} else {
isLogin.value = false;
// ElMessage.error(res.msg);//授权码被重复使用,不抛出异常。
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!