refactor: 将跳转放到最后

This commit is contained in:
eric
2026-01-09 23:13:06 +08:00
parent 13c8318adc
commit 1cb53e943e

View File

@@ -89,21 +89,21 @@ export const useAuthStore = defineStore('auth', () => {
resetAllStores();
accessStore.setLoginExpired(false);
// 回登录页带上当前路由地址
await router.replace({
path: LOGIN_PATH,
query: redirect
? {
redirect: encodeURIComponent(router.currentRoute.value.fullPath),
}
: {},
});
} catch {
// 不做任何处理
} finally {
isLoggingOut.value = false; // 重置 标识
}
// 回登录页带上当前路由地址
await router.replace({
path: LOGIN_PATH,
query: redirect
? {
redirect: encodeURIComponent(router.currentRoute.value.fullPath),
}
: {},
});
}
async function fetchUserInfo() {