router.beforeEach((to, from, next) => { if(to.path!='/login' && localStorage.token==undefined){ next('/login') return } next() }) 相关文章: