优化:登录页获取验证码

pull/57/head
李强 2022-05-13 01:45:27 +08:00
parent af5e917643
commit 9b77fc1982
1 changed files with 8 additions and 8 deletions

View File

@ -21,7 +21,7 @@ export default {
helpUrl: (state) => state.settings.helpUrl, //
privacyUrl: (state) => state.settings.privacyUrl, //
clauseUrl: (state) => state.settings.clauseUrl, //
captchaState: (state) => state.settings.captchaState || true//
captchaState: (state) => state.settings.captchaState//
})
},
beforeCreate () {
@ -81,13 +81,13 @@ export default {
* 获取验证码
*/
getCaptcha () {
if (this.captchaState) {
api.getCaptcha().then((ret) => {
this.formLogin.captcha = null
this.captchaKey = ret.data.key
this.image_base = ret.data.image_base
})
}
console.log(2, this.captchaState, this.captchaState !== undefined)
if (this.captchaState !== undefined && !this.captchaState) return
api.getCaptcha().then((ret) => {
this.formLogin.captcha = null
this.captchaKey = ret.data.key
this.image_base = ret.data.image_base
})
},
/**
* @description 提交表单