原因:next函数没有加括号()
错误代码
router.beforeEach((to,from,next)=>{
console.log(to,from,next)
if(to.path==='/login') return next
})
改成
router.beforeEach((to,from,next)=>{
console.log(to,from,next)
if(to.path==='/login') return next()
})
原因:next函数没有加括号()
错误代码
router.beforeEach((to,from,next)=>{
console.log(to,from,next)
if(to.path==='/login') return next
})
改成
router.beforeEach((to,from,next)=>{
console.log(to,from,next)
if(to.path==='/login') return next()
})