From 6fde089ba62ea3b8659a872fa149bd517b7ab205 Mon Sep 17 00:00:00 2001 From: KAI <1373639299@qq.com> Date: Thu, 10 Oct 2024 07:17:21 +0000 Subject: [PATCH] =?UTF-8?q?fix(job):=20=E4=BF=AE=E5=A4=8D=E9=A2=84?= =?UTF-8?q?=E8=A7=88CRON=E8=A1=A8=E8=BE=BE=E5=BC=8F=E7=BB=93=E6=9E=9C?= =?UTF-8?q?=E4=B8=8D=E6=AD=A3=E7=A1=AE=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/index.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/utils/index.ts b/src/utils/index.ts index 23fb080..80a2f5b 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -326,7 +326,11 @@ export function dateFormat(date = new Date(), pattern = YMD_HMS) { */ const expressionNoYear = (cron: string) => { const vs = cron.split(' ') - return vs.slice(0, vs.length - 1).join(' ') + // 长度=== 7 包含年表达式 不解析 + if (vs.length === 7) { + return vs.slice(0, vs.length - 1).join(' ') + } + return cron } /**