异常处理

This commit is contained in:
2024-06-05 17:54:18 +08:00
parent f0ca5624ea
commit 9d138814f2
4 changed files with 24 additions and 14 deletions

View File

@@ -196,10 +196,14 @@ const fetchCompanyList = (fn: any = undefined) => {
} else {
let index = companyList.value.findIndex((res: { id: string }) => res.id === getApp().globalData?.companyId);
//未在当前公司下注册
if(index < 0 && !getApp()?.globalData?.storeId) {
goPath('/pages/common/register/index');
return;
if(index < 0) {
if(!getApp()?.globalData?.storeId) {
goPath('/pages/common/register/index');
return;
}
index = 0;
}
userStore.setUserInfo(userList.value[index]);
userStore.setCompanyInfo(companyList.value[index]);
avatarModifyRemind();