优化手机号码登录时图形验证码校验问题

This commit is contained in:
BianLzhaoMin 2024-05-27 15:40:46 +08:00
parent 8290727283
commit 397b31a548
1 changed files with 13 additions and 9 deletions

View File

@ -413,15 +413,19 @@ export default {
if (res.code == 200) { if (res.code == 200) {
this.$modal.msgSuccess('发送成功') this.$modal.msgSuccess('发送成功')
const TIME_COUNT = 60 const TIME_COUNT = 60
this.timer = setInterval(() => { if (!this.timer) {
if (this.count > 0 && this.count <= TIME_COUNT) { this.count = TIME_COUNT
this.count-- this.show = 2
} else { this.timer = setInterval(() => {
this.show = 3 if (this.count > 0 && this.count <= TIME_COUNT) {
clearInterval(this.timer) this.count--
this.timer = null } else {
} this.show = 3
}, 1000) clearInterval(this.timer)
this.timer = null
}
}, 1000)
}
} }
}) })
.finally(() => { .finally(() => {