bugfix: 解决后台没有验证码接口的时候,前端页面关闭了验证码依旧向后台发送验证码导致报错的情况

This commit is contained in:
SimpleWu 2022-07-13 11:02:46 +08:00
parent 77ac99a1d0
commit 3d83a310ea

View File

@ -108,14 +108,13 @@ export default {
this.getCookie();
},
methods: {
getCode() {
getCodeImg().then(res => {
this.captchaOnOff = res.data.captchaOnOff === undefined ? true : res.data.captchaOnOff;
if (this.captchaOnOff) {
getCode() {
if(this.captchaOnOff){
getCodeImg().then(res => {
this.codeUrl = "data:image/gif;base64," + res.data.img;
this.loginForm.uuid = res.data.uuid;
}
});
});
}
},
getCookie() {
const username = Cookies.get("username");