@@ -56,6 +56,13 @@ router.beforeEach((to, from, next) => {
})
}
} else {
+ // 如果有token,并且是登录页 直接返回首页
+ if (hasToken && to.path === "/login") {
+ next({
+ path: "/"
+ })
+ return
+ }
if (authWhiteList.includes(to.path) || isRegWhite(regWhiteList, to.path)) {
next()