//全局守卫
router.beforeEach((to,from,next)=>{
// alert('还没有登陆,请先登录');
// next();//确认后可以显示
//判断store.getters.isLogin === false
if(to.path == '/login' || to.path =='/register') {
next();
}else{
alert('请先登录');
next('./login')
}
})
//全局守卫
router.beforeEach((to,from,next)=>{
// alert('还没有登陆,请先登录');
// next();//确认后可以显示
//判断store.getters.isLogin === false
if(to.path == '/login' || to.path =='/register') {
next();
}else{
alert('请先登录');
next('./login')
}
})