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 { @@ -52,7 +53,8 @@ // 在免登录白名单,直接进入 next(); } else { next(`/login?redirect=${to.fullPath}`); // 否则全部重定向到登录页 const redirect = encodeURIComponent(to.fullPath || '/'); next(`/login?redirect=${redirect}`); // 否则全部重定向到登录页 NProgress.done(); } }