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

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

View File

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