This commit is contained in:
chaosBreaking
2019-10-04 17:53:49 +08:00
parent 49942c99bc
commit d094299226
6 changed files with 56 additions and 40 deletions

View File

@@ -51,18 +51,18 @@ const router = new Router({
],
})
router.beforeEach((to, _, next) => {
const loginPage = to.path === '/login'
const signed = store.getters.isLogin
if (!loginPage && !signed) {
next('/login')
return
}
if (loginPage && signed) {
next('/owner')
return
}
next()
})
// router.beforeEach((to, _, next) => {
// const loginPage = to.path === '/login'
// const signed = store.getters.isLogin
// if (!loginPage && !signed) {
// next('/login')
// return
// }
// if (loginPage && signed) {
// next('/home')
// return
// }
// next()
// })
export default router