Skip to content

Commit 9c4889f

Browse files
authored
fix(perm-guard): Fix the problem that the routing query is lost after refreshing the page (#941)
1 parent 59cf860 commit 9c4889f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/router/guard/permissionGuard.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ export function createPermissionGuard(router: Router) {
8888

8989
if (to.name === PAGE_NOT_FOUND_ROUTE.name) {
9090
// 动态添加路由后,此处应当重定向到fullPath,否则会加载404页面内容
91-
next({ path: to.fullPath, replace: true });
91+
// fix: 添加query以免丢失
92+
next({ path: to.fullPath, replace: true, query: to.query });
9293
} else {
9394
const redirectPath = (from.query.redirect || to.path) as string;
9495
const redirect = decodeURIComponent(redirectPath);

0 commit comments

Comments
 (0)