From efac81124631090d45d850380e2cc2c403252c88 Mon Sep 17 00:00:00 2001 From: wangsongsole Date: Mon, 25 Mar 2024 19:36:15 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=A6=80=EF=B8=8F=20fix:=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packkey/combining.html | 12 +++++++++--- packkey/reduce.html | 12 +++++++++--- packkey/ysf-reduce.html | 12 +++++++++--- packkey/zfb-reduce.html | 12 +++++++++--- 4 files changed, 36 insertions(+), 12 deletions(-) diff --git a/packkey/combining.html b/packkey/combining.html index 76fb2c4..f0f5e4f 100644 --- a/packkey/combining.html +++ b/packkey/combining.html @@ -157,11 +157,17 @@ /* 倒计时 */ const key_expiration_time = sessionStorage.getItem('key_expiration_time'); if (key_expiration_time != 0) { - setInterval(() => { - this.outTime = pageOutTime(key_expiration_time); + const cls = setInterval(() => { + const time = pageOutTime(key_expiration_time); + if (time) { + this.outTime = time; + } else { + this.outTime = ['00', '00', '00']; + clearInterval(cls); + } }, 1000); } else { - this.outTime = []; + this.outTime = ['00', '00', '00']; } }, diff --git a/packkey/reduce.html b/packkey/reduce.html index 4c6f7ec..1992cd8 100644 --- a/packkey/reduce.html +++ b/packkey/reduce.html @@ -185,11 +185,17 @@ /* 倒计时 */ const key_expiration_time = sessionStorage.getItem('key_expiration_time'); if (key_expiration_time != 0) { - setInterval(() => { - this.outTime = pageOutTime(key_expiration_time); + const cls = setInterval(() => { + const time = pageOutTime(key_expiration_time); + if (time) { + this.outTime = time; + } else { + this.outTime = ['00', '00', '00']; + clearInterval(cls); + } }, 1000); } else { - this.outTime = []; + this.outTime = ['00', '00', '00']; } }, filters: { diff --git a/packkey/ysf-reduce.html b/packkey/ysf-reduce.html index 90459c9..7ff7ce9 100644 --- a/packkey/ysf-reduce.html +++ b/packkey/ysf-reduce.html @@ -156,11 +156,17 @@ /* 倒计时 */ const key_expiration_time = sessionStorage.getItem('key_expiration_time'); if (key_expiration_time != 0) { - setInterval(() => { - this.outTime = pageOutTime(key_expiration_time); + const cls = setInterval(() => { + const time = pageOutTime(key_expiration_time); + if (time) { + this.outTime = time; + } else { + this.outTime = ['00', '00', '00']; + clearInterval(cls); + } }, 1000); } else { - this.outTime = []; + this.outTime = ['00', '00', '00']; } }, filters: { diff --git a/packkey/zfb-reduce.html b/packkey/zfb-reduce.html index 659e8d5..3b90f46 100644 --- a/packkey/zfb-reduce.html +++ b/packkey/zfb-reduce.html @@ -156,11 +156,17 @@ /* 倒计时 */ const key_expiration_time = sessionStorage.getItem('key_expiration_time'); if (key_expiration_time != 0) { - setInterval(() => { - this.outTime = pageOutTime(key_expiration_time); + const cls = setInterval(() => { + const time = pageOutTime(key_expiration_time); + if (time) { + this.outTime = time; + } else { + this.outTime = ['00', '00', '00']; + clearInterval(cls); + } }, 1000); } else { - this.outTime = []; + this.outTime = ['00', '00', '00']; } }, From c7b956bbf714a1e33e5c17314175f6155a3d3032 Mon Sep 17 00:00:00 2001 From: wangsongsole Date: Mon, 25 Mar 2024 19:36:25 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=92=AA=20optimize:=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- combining.html | 12 +++++++++--- reduce.html | 12 +++++++++--- ysf-reduce.html | 12 +++++++++--- zfb-reduce.html | 12 +++++++++--- 4 files changed, 36 insertions(+), 12 deletions(-) diff --git a/combining.html b/combining.html index b876eb2..26e3426 100644 --- a/combining.html +++ b/combining.html @@ -157,11 +157,17 @@ /* 倒计时 */ const key_expiration_time = sessionStorage.getItem('key_expiration_time'); if (key_expiration_time != 0) { - setInterval(() => { - this.outTime = pageOutTime(key_expiration_time); + const cls = setInterval(() => { + const time = pageOutTime(key_expiration_time); + if (time) { + this.outTime = time; + } else { + this.outTime = ['00', '00', '00']; + clearInterval(cls); + } }, 1000); } else { - this.outTime = []; + this.outTime = ['00', '00', '00']; } }, diff --git a/reduce.html b/reduce.html index 1198c1a..ab15f5b 100644 --- a/reduce.html +++ b/reduce.html @@ -186,11 +186,17 @@ /* 倒计时 */ const key_expiration_time = sessionStorage.getItem('key_expiration_time'); if (key_expiration_time != 0) { - setInterval(() => { - this.outTime = pageOutTime(key_expiration_time); + const cls = setInterval(() => { + const time = pageOutTime(key_expiration_time); + if (time) { + this.outTime = time; + } else { + this.outTime = ['00', '00', '00']; + clearInterval(cls); + } }, 1000); } else { - this.outTime = []; + this.outTime = ['00', '00', '00']; } }, filters: { diff --git a/ysf-reduce.html b/ysf-reduce.html index 51d905a..e8a72d6 100644 --- a/ysf-reduce.html +++ b/ysf-reduce.html @@ -152,11 +152,17 @@ /* 倒计时 */ const key_expiration_time = sessionStorage.getItem('key_expiration_time'); if (key_expiration_time != 0) { - setInterval(() => { - this.outTime = pageOutTime(key_expiration_time); + const cls = setInterval(() => { + const time = pageOutTime(key_expiration_time); + if (time) { + this.outTime = time; + } else { + this.outTime = ['00', '00', '00']; + clearInterval(cls); + } }, 1000); } else { - this.outTime = []; + this.outTime = ['00', '00', '00']; } }, filters: { diff --git a/zfb-reduce.html b/zfb-reduce.html index 4e3555e..55841cb 100644 --- a/zfb-reduce.html +++ b/zfb-reduce.html @@ -151,11 +151,17 @@ /* 倒计时 */ const key_expiration_time = sessionStorage.getItem('key_expiration_time'); if (key_expiration_time != 0) { - setInterval(() => { - this.outTime = pageOutTime(key_expiration_time); + const cls = setInterval(() => { + const time = pageOutTime(key_expiration_time); + if (time) { + this.outTime = time; + } else { + this.outTime = ['00', '00', '00']; + clearInterval(cls); + } }, 1000); } else { - this.outTime = []; + this.outTime = ['00', '00', '00']; } },