d3b04ac1 by lihua

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

1 parent 67f5a5df
...@@ -54,17 +54,13 @@ const useUserStore = defineStore( ...@@ -54,17 +54,13 @@ 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 } else { 63 return getSystemMenu({ tenantGuid: currentTenantGuid.value }).then((info: any) => { //解决页面调用流程接口传递staffGuid,为空的问题
64 ElMessage.error(res.msg)
65 }
66 })
67 return getSystemMenu({ tenantGuid: currentTenantGuid.value }).then((info: any) => {
68 if (info.code == '00000') { 64 if (info.code == '00000') {
69 localStorage.setItem('userInfoData', JSON.stringify(info.data)); 65 localStorage.setItem('userInfoData', JSON.stringify(info.data));
70 userInfoData.value = info.data; 66 userInfoData.value = info.data;
...@@ -73,6 +69,10 @@ const useUserStore = defineStore( ...@@ -73,6 +69,10 @@ const useUserStore = defineStore(
73 } 69 }
74 }) 70 })
75 } else { 71 } else {
72 ElMessage.error(res.msg)
73 }
74 })
75 } else {
76 isLogin.value = false; 76 isLogin.value = false;
77 // ElMessage.error(res.msg);//授权码被重复使用,不抛出异常。 77 // ElMessage.error(res.msg);//授权码被重复使用,不抛出异常。
78 } 78 }
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!