Commit 6b94a9f1 by 姜雷

修改获取验证码逻辑

parent e34e56d5
......@@ -106,7 +106,7 @@ export default {
};
},
created() {
this.fetchVcode();
this.getVcode();
},
methods: {
...mapActions(['Login']),
......@@ -172,13 +172,17 @@ export default {
}
},
fetchVcode() {
fetchVcode()
this.getVcode().then(() => {
this.loginForm.vcode = '';
this.$refs.vcode.focus();
});
},
getVcode() {
return fetchVcode()
.then(res => {
console.log(res);
const { saltKey, verifyCode } = res;
this.verifyCode = verifyCode;
this.loginForm.vcode = '';
this.$refs.vcode.focus();
})
.catch(err => {
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