Browse Source

fix: missing route data in guard, fixed: #4108 (#4115)

Netfan 7 months ago
parent
commit
9d6cc22dfa
1 changed files with 2 additions and 2 deletions
  1. 2 2
      apps/web-antd/src/router/guard.ts

+ 2 - 2
apps/web-antd/src/router/guard.ts

@@ -115,10 +115,10 @@ function setupAccessGuard(router: Router) {
     // 保存菜单信息和路由信息
     accessStore.setAccessMenus(accessibleMenus);
     accessStore.setAccessRoutes(accessibleRoutes);
-    const redirectPath = (from.query.redirect ?? to.path) as string;
+    const redirectPath = (from.query.redirect ?? to.fullPath) as string;
 
     return {
-      path: decodeURIComponent(redirectPath),
+      ...router.resolve(decodeURIComponent(redirectPath)),
       replace: true,
     };
   });