From 76bd8de05a521677e7c4e57b8e1143a5c21453e7 Mon Sep 17 00:00:00 2001 From: NorthLan <6995syu@163.com> Date: Tue, 20 Jul 2021 10:33:01 +0800 Subject: [PATCH] =?UTF-8?q?fix(perm-guard):=20=E4=BF=AE=E5=A4=8D=E5=88=B7?= =?UTF-8?q?=E6=96=B0=E9=A1=B5=E9=9D=A2=E5=90=8E=E8=B7=AF=E7=94=B1=20query?= =?UTF-8?q?=20=E4=B8=A2=E5=A4=B1=E7=9A=84=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/guard/permissionGuard.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/router/guard/permissionGuard.ts b/src/router/guard/permissionGuard.ts index 1fe9e7507ff..4a4395c7901 100644 --- a/src/router/guard/permissionGuard.ts +++ b/src/router/guard/permissionGuard.ts @@ -88,7 +88,8 @@ export function createPermissionGuard(router: Router) { if (to.name === PAGE_NOT_FOUND_ROUTE.name) { // 动态添加路由后,此处应当重定向到fullPath,否则会加载404页面内容 - next({ path: to.fullPath, replace: true }); + // fix: 添加query以免丢失 + next({ path: to.fullPath, replace: true, query: to.query }); } else { const redirectPath = (from.query.redirect || to.path) as string; const redirect = decodeURIComponent(redirectPath);