perf: 已登录状态访问登录页面自动跳转到首页

This commit is contained in:
xiaojunnuo
2026-02-09 23:08:13 +08:00
parent 519bf3184a
commit bd8caff0b7
2 changed files with 9 additions and 5 deletions
@@ -101,6 +101,14 @@ function setupAccessGuard(router: Router) {
return r.meta?.auth || r.meta?.permission;
});
if (to.path === LOGIN_PATH && accessStore.accessToken) {
return {
path: DEFAULT_HOME_PATH,
// 携带当前跳转的页面,登录后重新跳转该页面
replace: true,
};
}
if (!needAuth) {
return true;
}