refactor: 去掉是否登录无用逻辑

This commit is contained in:
RubyLiu 2023-08-23 14:35:27 +08:00 committed by 刘瑞斌
parent dbbac51244
commit 4acb1026b0
2 changed files with 2 additions and 8 deletions

View File

@ -68,11 +68,7 @@
console.log(error); console.log(error);
} }
}); });
onMounted(async () => { onMounted(() => {
const res = await userStore.isLogin(); userStore.isLogin();
if (!res) {
const router = useRouter();
router.push({ name: 'login' });
}
}); });
</script> </script>

View File

@ -103,12 +103,10 @@ const useUserStore = defineStore('user', {
if (appStore.currentOrgId === '') { if (appStore.currentOrgId === '') {
appStore.setCurrentOrgId(res.lastOrganizationId || ''); appStore.setCurrentOrgId(res.lastOrganizationId || '');
} }
return true;
} catch (err) { } catch (err) {
const { t } = useI18n(); const { t } = useI18n();
Message.error(t('message.loginExpired')); Message.error(t('message.loginExpired'));
this.logoutCallBack(); this.logoutCallBack();
return false;
} }
}, },
}, },