登录处理
This commit is contained in:
@@ -21,4 +21,12 @@ const router = createRouter({
|
||||
],
|
||||
})
|
||||
|
||||
router.beforeEach((to, _from, next) => {
|
||||
if (to.path === '/user-center' && !localStorage.getItem('Authorization')) {
|
||||
next({ path: '/', query: { login: 'true' } })
|
||||
} else {
|
||||
next()
|
||||
}
|
||||
})
|
||||
|
||||
export default router
|
||||
|
||||
Reference in New Issue
Block a user