Browse Source

验证码优化

rongxin_prod
庞东旭 1 year ago
parent
commit
037d9ec431
1 changed files with 7 additions and 3 deletions
  1. +7
    -3
      src/views/login.vue

+ 7
- 3
src/views/login.vue View File

@@ -149,7 +149,9 @@ export default {
code:null, code:null,
isSmsLogin: false, //是否手机验证码 isSmsLogin: false, //是否手机验证码
computeTime: 0, computeTime: 0,
height:0
height:0,
uuid:'',
uuidPhone:'',
}; };
}, },
created() { created() {
@@ -171,13 +173,13 @@ export default {
methods: { methods: {
getCode() { getCode() {
getCodeImg().then((res) => { getCodeImg().then((res) => {
this.formData.uuid = res.uuid;
this.uuid = res.uuid;
this.codeUrl = "data:image/gif;base64," + res.img; this.codeUrl = "data:image/gif;base64," + res.img;
}); });
}, },
getCodePhone() { getCodePhone() {
getCodeImg().then((res) => { getCodeImg().then((res) => {
this.formData.uuid = res.uuid;
this.uuidPhone = res.uuid;
this.codeUrlPhone = "data:image/gif;base64," + res.img; this.codeUrlPhone = "data:image/gif;base64," + res.img;
}); });
}, },
@@ -242,6 +244,7 @@ export default {
} }
this.loading = true; this.loading = true;
this.formData.code = this.mobileCode; this.formData.code = this.mobileCode;
this.formData.uuid = this.uuidPhone
this.$store this.$store
.dispatch("SmsLogin", this.formData) .dispatch("SmsLogin", this.formData)
.then(() => { .then(() => {
@@ -278,6 +281,7 @@ export default {
return false; return false;
} }
this.formData.code = this.code; this.formData.code = this.code;
this.formData.uuid = this.uuid;
this.$store this.$store
.dispatch("Login", this.formData) .dispatch("Login", this.formData)
.then(() => { .then(() => {


Loading…
Cancel
Save