refactor(router): 优化错误页面路由跳转逻辑
This commit is contained in:
@@ -56,6 +56,10 @@ export function setupPermissionGuard() {
|
||||
|
||||
// 路由 404 检查
|
||||
if (to.matched.length === 0) {
|
||||
// 从登录页跳转且目标路径无效,回退首页(避免不同用户权限不同导致的 404)
|
||||
if (_from.path === "/login") {
|
||||
return { path: "/", replace: true };
|
||||
}
|
||||
return "/404";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user