|
@@ -97,13 +97,13 @@ router.beforeEach((to, from, next) => {
|
|
|
localStorage.getItem('user') || '{role: { menus: [] }}',
|
|
|
)
|
|
|
const haveAuth = checkAuth(menus, to.path)
|
|
|
- if (!token || !haveAuth) {
|
|
|
+ if (!token || !haveAuth.path) {
|
|
|
localStorage.removeItem('phone')
|
|
|
localStorage.removeItem('token')
|
|
|
localStorage.removeItem('user')
|
|
|
return next('/login')
|
|
|
}
|
|
|
- if (to.path === '/') return next(token ? '/authorized/originality' : '/login')
|
|
|
+ if (to.path === '/') return next(token ? haveAuth.path : '/login')
|
|
|
next()
|
|
|
})
|
|
|
|