若依登录后跳转到指定页面(保留原首页)
//1.router新建指定的页面
{
path: '/xinyemian',
component: (resolve) => require(['@/views/xinyemian'], resolve),
hidden: true
},
//2.login登录成功后修改跳转页面
this.$store .dispatch("Login", this.loginForm) .then(() => {
this.$router.push({ path: '/xinyemian' }).catch(() => { })
})
//3.退出登录后跳转修改为指定页面
.then(() => {
this.$store.dispatch("LogOut").then(() => {
location.href = "/xinyemian";
});
})
```