|
@@ -161,18 +161,22 @@
|
|
|
});
|
|
|
},
|
|
|
handleLogin() {
|
|
|
- this.$refs.form.validate(async (valid) => {
|
|
|
+ this.$refs.form.validate((valid) => {
|
|
|
if (valid) {
|
|
|
this.loading = true;
|
|
|
- await this.$store.dispatch("user/login", this.form).catch(() => {
|
|
|
- this.loading = false;
|
|
|
- });
|
|
|
- const routerPath =
|
|
|
- this.redirect === "/404" || this.redirect === "/401"
|
|
|
- ? "/"
|
|
|
- : this.redirect;
|
|
|
- await this.$router.push(routerPath).catch(() => {});
|
|
|
- this.loading = false;
|
|
|
+ this.$store
|
|
|
+ .dispatch("user/login", this.form)
|
|
|
+ .then(() => {
|
|
|
+ const routerPath =
|
|
|
+ this.redirect === "/404" || this.redirect === "/401"
|
|
|
+ ? "/"
|
|
|
+ : this.redirect;
|
|
|
+ this.$router.push(sssrouterPath).catch(() => {});
|
|
|
+ this.loading = false;
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
} else {
|
|
|
return false;
|
|
|
}
|