Skip to content

Commit

Permalink
fix(perm-guard): Fix the problem that the routing query is lost after…
Browse files Browse the repository at this point in the history
… refreshing the page (#941)
  • Loading branch information
noahlann authored Jul 21, 2021
1 parent 59cf860 commit 9c4889f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/router/guard/permissionGuard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9c4889f

Please sign in to comment.