修复提现定时器未清除问题

This commit is contained in:
YeMingfei666 2024-12-19 16:20:00 +08:00
parent 35eaae83dc
commit 491e0f1ae2
1 changed files with 7 additions and 4 deletions

View File

@ -941,14 +941,15 @@ export default {
reset() {
console.log("reset");
this.msg = "";
this.timer = null;
clearInterval(this.timer);
this.msgTime = 60;
clearInterval(this.timer);
this.timer = null;
},
sendMsg() {
if (this.msgTime < 60) {
return;
}
var that = this;
this.$http({
// url: this.$http.adornUrl('app/Login/sendMsg/'+this.tableData.mobile+'/regis'),
url: this.$http.adornUrl(
@ -963,7 +964,9 @@ export default {
type: "success",
});
this.msgTime--;
this.timer = setInterval(() => {
clearInterval(this.timer);
that.timer = setInterval(() => {
console.log(this.msgTime);
this.msgTime--;
if (this.msgTime == 0) {
clearInterval(this.timer);
@ -972,7 +975,7 @@ export default {
}, 1000);
} else {
this.$message({
message: res.data.msg|| "发送失败",
message: res.data.msg || "发送失败",
type: "error",
});
}