From a07d6737761862a97570ca02c79ba885cf34aeb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9B=AE=E6=A3=83?= Date: Thu, 9 May 2024 17:20:21 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9A=A1=EF=B8=8F=20=E5=AE=8C=E5=96=84?= =?UTF-8?q?=E5=85=AC=E5=91=8A=E6=AD=A3=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/common/Announcements.vue | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/pages/common/Announcements.vue b/src/pages/common/Announcements.vue index 7a08f96f..4630f9ec 100644 --- a/src/pages/common/Announcements.vue +++ b/src/pages/common/Announcements.vue @@ -184,7 +184,7 @@ async function loadData(): Promise { function getAnnoTime(content: string): string | false { const regexes = [ /〓活动时间〓.*?\d\.\d版本期间持续开放/, - /(?:〓活动时间〓|〓任务开放时间〓).*?\d\.\d版本更新(?:完成|)后永久开放/, + /(?:〓活动时间〓|〓任务开放时间〓).*?(?:(\d\.\d版本更新(?:完成|))|(\d{4}\/\d{2}\/\d{2} \d{2}:\d{2}:\d{2}).*?)后永久开放/, /(?:〓(?:活动|折扣)时间〓|祈愿时间|【上架时间】).*?(\d\.\d版本更新后).*?~.*?<t class="t_(?:gl|lc)".*?>(.*?)<\/t>/, /(?:〓(?:活动|折扣)时间〓|祈愿时间|【上架时间】).*?<t class="t_(?:gl|lc)".*?>(.*?)<\/t>.*?~.*?<t class="t_(?:gl|lc)".*?>(.*?)<\/t>/, /〓活动时间〓.*?(\d{4}\/\d{2}\/\d{2} \d{2}:\d{2}:\d{2}).*?(\d\.\d版本结束)/, @@ -198,8 +198,11 @@ function getAnnoTime(content: string): string | false { const res = content.match(regexes[1]); if (res === null) return false; const regex2 = /\d\.\d版本更新(?:完成|)后永久开放/; + const regex3 = /\d{4}\/\d{2}\/\d{2} \d{2}:\d{2}:\d{2}/; const res2 = res[0].match(regex2); - return res2 === null ? false : res2[0]; + if (res2 !== null) return res2[0]; + const res3 = res[0].match(regex3); + return res3 === null ? false : `${res3[0]} 后永久开放`; } if (content.match(regexes[2])) { const res = content.match(regexes[2]); @@ -211,7 +214,7 @@ function getAnnoTime(content: string): string | false { } if (content.match(regexes[4])) { const res = content.match(regexes[4]); - if (res != null) { + if (res !== null) { const cnt = res[0].match(/〓/g); if (cnt && cnt.length > 2) return false; }