登录后push添加catch防止出现检查错误

This commit is contained in:
RuoYi
2020-12-15 10:04:09 +08:00
parent 8988d0b4ab
commit 4f33da2a3f
2 changed files with 8 additions and 21 deletions

View File

@ -126,15 +126,12 @@ export default {
Cookies.remove("password");
Cookies.remove('rememberMe');
}
this.$store
.dispatch("Login", this.loginForm)
.then(() => {
this.$router.push({ path: this.redirect || "/" });
})
.catch(() => {
this.loading = false;
this.getCode();
});
this.$store.dispatch("Login", this.loginForm).then(() => {
this.$router.push({ path: this.redirect || "/" }).catch(()=>{});
}).catch(() => {
this.loading = false;
this.getCode();
});
}
});
}