提交 a6926865 authored 作者: 胡园辉's avatar 胡园辉

fix(路由放开)

上级 9f849171
......@@ -5,17 +5,17 @@ const whiteRoutes = ["/login", "/sso"]
export default (router: Router) => {
router.beforeEach((to, from, next) => {
// const token = localStorage.getItem(TOKEN_KEY)
// if (whiteRoutes.includes(to.path)) {
// return next()
// }
const token = localStorage.getItem(TOKEN_KEY)
if (whiteRoutes.includes(to.path)) {
return next()
}
// if (!token) {
// router.replace(BaseRouteRouter.LOGIN);
// } else {
// next()
// }
next()
if (!token) {
router.replace(BaseRouteRouter.LOGIN);
} else {
next()
}
// next()
})
return router
}
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论