无权限跳转next({path:'/404'}),直接死循环
router.beforeEach((to,from,next) => {
if(tooken) { // 已登录
if(to.path === '/login'){
next({path: '/'})
} else {
if(hasAuth){ // 有权限
next()
} else {
next({path: '/401'}) // 这块陷入死循环了
}
}
} else {
}
})