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(); this.getCookie();
}, },
methods: { methods: {
getCode() { getCode() {
getCodeImg().then(res => { if(this.captchaOnOff){
this.captchaOnOff = res.data.captchaOnOff === undefined ? true : res.data.captchaOnOff; getCodeImg().then(res => {
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");