This commit is contained in:
xiongchengqiang 2020-05-18 18:04:58 +08:00
commit 6e078fb38e

View File

@ -21,7 +21,7 @@
</el-input> </el-input>
</el-col> </el-col>
<el-col :span="10" class="login-captcha"> <el-col :span="10" class="login-captcha">
<img @click="handleGetImgCaptcha()" id="img-captcha" :src="'/lz_management/captcha.jpg?uuid='+ this.dataForm.uuid"> <img :src="captchaPath" @click="handleGetImgCaptcha()">
</el-col> </el-col>
</el-row> </el-row>
</el-form-item> </el-form-item>
@ -43,8 +43,8 @@
data () { data () {
return { return {
dataForm: { dataForm: {
username: 'test', username: '',
password: '1234567', password: '',
uuid: '', uuid: '',
captcha: '' captcha: ''
}, },
@ -53,18 +53,17 @@
password: [{ required: true, message: '密码不能为空', trigger: 'blur' }], password: [{ required: true, message: '密码不能为空', trigger: 'blur' }],
captcha: [{ required: true, message: '验证码不能为空', trigger: 'blur' }] captcha: [{ required: true, message: '验证码不能为空', trigger: 'blur' }]
}, },
captchaPath: '' captchaPath: '' //
} }
}, },
created () { created () {
this.dataForm.uuid = getUUID() this.handleGetImgCaptcha()
}, },
methods: { methods: {
// //
handleGetImgCaptcha () { handleGetImgCaptcha () {
this.dataForm.uuid = getUUID() this.dataForm.uuid = getUUID()
let imgSrc = document.getElementById('img-captcha') this.captchaPath = `/lz_management/captcha.jpg?uuid=${this.dataForm.uuid}`
imgSrc.setAttribute('src', '/lz_management/captcha.jpg?uuid=' + this.dataForm.uuid)
}, },
// //
handleLogin () { handleLogin () {