refactor(router): 优化错误页面路由跳转逻辑
This commit is contained in:
@@ -160,7 +160,9 @@ function logout() {
|
||||
lockScroll: false,
|
||||
}).then(() => {
|
||||
userStore.logout().then(() => {
|
||||
router.push(`/login?redirect=${route.fullPath}`);
|
||||
// 若当前已在 404/401 等错误页,退出后不再跳回错误页
|
||||
const redirect = ["/404", "/401"].includes(route.path) ? "/" : route.fullPath;
|
||||
router.push(`/login?redirect=${encodeURIComponent(redirect)}`);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user