update 登录优化

This commit is contained in:
yoe 2020-05-18 10:54:36 +08:00
parent 88260bc3af
commit 380588340d

View File

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