|
|
@ -122,17 +122,18 @@ export default { |
|
|
|
if (valid) { |
|
|
|
if (valid) { |
|
|
|
this.loginForm.distinguish = Number(this.activeName); |
|
|
|
this.loginForm.distinguish = Number(this.activeName); |
|
|
|
this.$post(this.api.logins, this.loginForm).then(res => { |
|
|
|
this.$post(this.api.logins, this.loginForm).then(res => { |
|
|
|
|
|
|
|
if (res && res.status == 30001) { |
|
|
|
|
|
|
|
this.phoneVisible = true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.getVerImg(); |
|
|
|
|
|
|
|
this.loginForm.code = ""; |
|
|
|
util.local.set(Setting.tokenKey, res.data.token, Setting.tokenExpires); |
|
|
|
util.local.set(Setting.tokenKey, res.data.token, Setting.tokenExpires); |
|
|
|
let redirect = this.$route.query.redirect ? decodeURIComponent(this.$route.query.redirect) : "/index"; |
|
|
|
let redirect = this.$route.query.redirect ? decodeURIComponent(this.$route.query.redirect) : "/index"; |
|
|
|
this.$router.replace(redirect); |
|
|
|
this.$router.replace(redirect); |
|
|
|
util.successMsg("登录成功"); |
|
|
|
util.successMsg("登录成功"); |
|
|
|
this.queryCustomer(); |
|
|
|
this.queryCustomer(); |
|
|
|
}).catch(res => { |
|
|
|
}).catch(res => { |
|
|
|
if (res && res.status == 30001) { |
|
|
|
|
|
|
|
this.phoneVisible = true; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.getVerImg(); |
|
|
|
|
|
|
|
this.loginForm.code = ""; |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
return util.errorMsg("请检查表单数据"); |
|
|
|
return util.errorMsg("请检查表单数据"); |
|
|
|