fix(系统设置): 进行路由权限校验时参数会被忽略掉
This commit is contained in:
parent
fd1d8e79ef
commit
f4889b7636
|
@ -78,10 +78,16 @@ function redirectLoginPath(originPath, next) {
|
||||||
if (!defaultMenuRoute) {
|
if (!defaultMenuRoute) {
|
||||||
// 记录标识,防止死循环
|
// 记录标识,防止死循环
|
||||||
sessionStorage.setItem('defaultMenuRoute', 'sign');
|
sessionStorage.setItem('defaultMenuRoute', 'sign');
|
||||||
originPath = getDefaultSecondLevelMenu(originPath);
|
let changedPath = getDefaultSecondLevelMenu(originPath);
|
||||||
next({path: originPath});
|
if (changedPath === originPath) {
|
||||||
if (router.currentRoute.fullPath === originPath) {
|
// 通过了权限校验,保留路由相关信息,直接放行
|
||||||
sessionStorage.setItem('redirectUrl', originPath);
|
next();
|
||||||
|
} else {
|
||||||
|
// 未通过校验,放行至有权限路由
|
||||||
|
next({path: changedPath});
|
||||||
|
}
|
||||||
|
if (router.currentRoute.fullPath === changedPath) {
|
||||||
|
sessionStorage.setItem('redirectUrl', changedPath);
|
||||||
// 路径相同时,移除标识
|
// 路径相同时,移除标识
|
||||||
sessionStorage.removeItem("defaultMenuRoute");
|
sessionStorage.removeItem("defaultMenuRoute");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue