VUE

router.beforeEach((to, from, next) => {
  
  if(to.path!=’/login’ && localStorage.token==undefined){
      next(‘/login’)
      return
  }
  next()
})

Related Posts

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注