优化:登录页获取验证码

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