Commit 6b94a9f1 by 姜雷

修改获取验证码逻辑

parent e34e56d5
...@@ -106,7 +106,7 @@ export default { ...@@ -106,7 +106,7 @@ export default {
}; };
}, },
created() { created() {
this.fetchVcode(); this.getVcode();
}, },
methods: { methods: {
...mapActions(['Login']), ...mapActions(['Login']),
...@@ -172,13 +172,17 @@ export default { ...@@ -172,13 +172,17 @@ export default {
} }
}, },
fetchVcode() { fetchVcode() {
fetchVcode() this.getVcode().then(() => {
this.loginForm.vcode = '';
this.$refs.vcode.focus();
});
},
getVcode() {
return fetchVcode()
.then(res => { .then(res => {
console.log(res); console.log(res);
const { saltKey, verifyCode } = res; const { saltKey, verifyCode } = res;
this.verifyCode = verifyCode; this.verifyCode = verifyCode;
this.loginForm.vcode = '';
this.$refs.vcode.focus();
}) })
.catch(err => { .catch(err => {
this.$message.error('获取验证码失败!'); this.$message.error('获取验证码失败!');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment