src/permission.ts
@@ -40,6 +40,7 @@ router.addRoute(route); // 动态添加可访问路由表 } }); // @ts-expect-error hack方法 确保addRoutes已完成 next({ path: to.path, replace: true, params: to.params, query: to.query, hash: to.hash, name: to.name as string }); // hack方法 确保addRoutes已完成 } } else { @@ -53,7 +54,7 @@ next(); } else { const redirect = encodeURIComponent(to.fullPath || '/'); next(`/login?redirect=${redirect}`) // 否则全部重定向到登录页 next(`/login?redirect=${redirect}`); // 否则全部重定向到登录页 NProgress.done(); } }