Browse Source

修改

master
wen 2 years ago
parent
commit
e6ce3c3577
  1. 30
      src/views/login/index.vue

30
src/views/login/index.vue

@ -55,8 +55,8 @@ @@ -55,8 +55,8 @@
auto-complete="on"
/>
</el-form-item>
<div class="captcha_main" v-loading="captcha_loading">
<img class="captcha_img" :src="captchaimg" alt="验证码"/>
<div class="captcha_main" @click="getCustomers" v-loading="captcha_loading">
<img v-if="!captcha_loading" class="captcha_img" :src="captchaimg" alt="验证码"/>
</div>
</div>
@ -104,6 +104,11 @@ export default { @@ -104,6 +104,11 @@ export default {
}
}
return {
loading: false,
captcha_loading: true, //
passwordType: 'password',
redirect: undefined,
loginForm: {
username: '',
password: '',
@ -116,11 +121,7 @@ export default { @@ -116,11 +121,7 @@ export default {
],
password: [{ required: true, trigger: 'blur', validator: validatePassword }],
captcha: [{ required: true, trigger: 'blur', validator: validateCaptcha }]
},
loading: false,
captcha_loading: false,
passwordType: 'password',
redirect: undefined
}
}
},
watch: {
@ -136,10 +137,12 @@ export default { @@ -136,10 +137,12 @@ export default {
//
getCustomers() {
let thiss = this;
axios.post('/api/captcha', 'refresh').then(function (response) {
this.captcha_loading = true;
axios.post('/api/captcha').then(function (response) {
let datamain = response.data;
thiss.captchaimg = datamain.data;
console.log(response);
thiss.captcha_loading = false;
//console.log(response);
}).catch(function (error) {
//console.log(error);
this.$message({
@ -165,12 +168,9 @@ export default { @@ -165,12 +168,9 @@ export default {
if (valid) {
this.loading = true
let thiss = this;
axios.post('/api/login', this.loginForm, {
headers: {
'Content-Type': 'multipart/form-data'
}
axios.post('/api/login', this.loginForm, {headers: {'Content-Type': 'multipart/form-data'}
}).then(function (response) {
console.log(thiss.$router)
console.log(response)
thiss.$router.push({path: '/usermange'})
console.log('6666');
}).catch(function (error) {
@ -301,7 +301,7 @@ $cursor: #3c3535; @@ -301,7 +301,7 @@ $cursor: #3c3535;
}
.captcha_k{display:flex;}
.captcha_k .captcha_main{width:100px;height:54px;margin: 0 0 0 15px;}
.captcha_k .captcha_img{border-radius:6px;display:block;max-width:100%;height:100%;}
.captcha_k .captcha_img{border-radius:6px;display:block;max-width:100%;height:100%;cursor:pointer;}
.captcha_k>.el-form-item{flex:1;}
}
</style>

Loading…
Cancel
Save