fix: support Chinese cron log names (#3068)

This commit is contained in:
whyour
2026-09-12 03:03:25 +08:00
parent 4df52094f2
commit d62d8f3025
6 changed files with 120 additions and 8 deletions
+2 -2
View File
@@ -75,7 +75,7 @@ export const commonCronSchema = {
}
if (
!/^(?!.*(?:^|\/)\.{1,2}(?:\/|$))(?:\/)?(?:[\w.-]+\/)*[\w.-]+\/?$/.test(
!/^(?!.*(?:^|\/)\.{1,2}(?:\/|$))(?:\/)?(?:[\w\p{Script=Han}.-]+\/)*[\w\p{Script=Han}.-]+\/?$/u.test(
value,
)
) {
@@ -87,7 +87,7 @@ export const commonCronSchema = {
return value;
})
.messages({
'string.pattern.base': '日志名称只能包含字母、数字、下划线连字符',
'string.pattern.base': '日志名称只能包含中文、字母、数字、下划线连字符、点和路径分隔符',
'string.max': '日志名称不能超过100个字符',
'string.unsafePath': '绝对路径必须在日志目录内或使用 /dev/null',
}),