mirror of
https://gitee.com/chu1204505056/vue-admin-beautiful.git
synced 2025-04-28 19:56:33 +08:00
修复登录时后端返回401无法跳转到401页面的bug,请务必更新
This commit is contained in:
parent
937782625e
commit
65f30c9119
@ -161,18 +161,22 @@
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleLogin() {
|
handleLogin() {
|
||||||
this.$refs.form.validate(async (valid) => {
|
this.$refs.form.validate((valid) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
await this.$store.dispatch("user/login", this.form).catch(() => {
|
this.$store
|
||||||
this.loading = false;
|
.dispatch("user/login", this.form)
|
||||||
});
|
.then(() => {
|
||||||
const routerPath =
|
const routerPath =
|
||||||
this.redirect === "/404" || this.redirect === "/401"
|
this.redirect === "/404" || this.redirect === "/401"
|
||||||
? "/"
|
? "/"
|
||||||
: this.redirect;
|
: this.redirect;
|
||||||
await this.$router.push(routerPath).catch(() => {});
|
this.$router.push(sssrouterPath).catch(() => {});
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user