修改用户退出后记录退出路径重定向不是欢迎界面问题

This commit is contained in:
Qi 2025-03-24 20:56:46 +08:00
parent 7b47fa447a
commit 657aebdc99
1 changed files with 4 additions and 3 deletions

View File

@ -141,7 +141,6 @@ export function createPermissionGuard(router: Router) {
// update-begin-author:sunjianlei date:20230306 for: 修复登录成功后,没有正确重定向的问题
redirect: to.fullPath,
// update-end-author:sunjianlei date:20230306 for: 修复登录成功后,没有正确重定向的问题
};
}
next(redirectData);
@ -189,11 +188,13 @@ export function createPermissionGuard(router: Router) {
if (to.name === PAGE_NOT_FOUND_ROUTE.name) {
// 动态添加路由后此处应当重定向到fullPath否则会加载404页面内容
next({ path: to.fullPath, replace: true, query: to.query });
//next({ path: to.fullPath, replace: true, query: to.query });
next({ path: PageEnum.BASE_HOME, replace: true, query: to.query });
} else {
const redirectPath = (from.query.redirect || to.path) as string;
const redirect = decodeURIComponent(redirectPath);
const nextData = to.path === redirect ? { ...to, replace: true } : { path: redirect };
//const nextData = to.path === redirect ? { ...to, replace: true } : { path: redirect };
const nextData = PageEnum.BASE_HOME;
next(nextData);
}
});