fix: 解决病毒定时扫描校验国际化的问题 (#5856)

pull/5868/head v1.10.12-lts
ssongliu 4 months ago committed by GitHub
parent f6c334bdad
commit 16a35141dd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -202,7 +202,7 @@ const verifySpec = (rule: any, value: any, callback: any) => {
!Number.isInteger(item.second) || !Number.isInteger(item.second) ||
!Number.isInteger(item.week) !Number.isInteger(item.week)
) { ) {
callback(new Error(i18n.global.t('cronjob.specErr'))); callback(new Error(i18n.global.t('toolbox.clam.specErr')));
return; return;
} }
switch (item.specType) { switch (item.specType) {
@ -215,7 +215,7 @@ const verifySpec = (rule: any, value: any, callback: any) => {
item.minute < 0 || item.minute < 0 ||
item.minute > 59 item.minute > 59
) { ) {
callback(new Error(i18n.global.t('cronjob.specErr'))); callback(new Error(i18n.global.t('toolbox.clam.specErr')));
return; return;
} }
break; break;
@ -228,7 +228,7 @@ const verifySpec = (rule: any, value: any, callback: any) => {
item.minute < 0 || item.minute < 0 ||
item.minute > 59 item.minute > 59
) { ) {
callback(new Error(i18n.global.t('cronjob.specErr'))); callback(new Error(i18n.global.t('toolbox.clam.specErr')));
return; return;
} }
break; break;
@ -241,36 +241,36 @@ const verifySpec = (rule: any, value: any, callback: any) => {
item.minute < 0 || item.minute < 0 ||
item.minute > 59 item.minute > 59
) { ) {
callback(new Error(i18n.global.t('cronjob.specErr'))); callback(new Error(i18n.global.t('toolbox.clam.specErr')));
return; return;
} }
break; break;
case 'perDay': case 'perDay':
if (item.hour < 0 || item.hour > 23 || item.minute < 0 || item.minute > 59) { if (item.hour < 0 || item.hour > 23 || item.minute < 0 || item.minute > 59) {
callback(new Error(i18n.global.t('cronjob.specErr'))); callback(new Error(i18n.global.t('toolbox.clam.specErr')));
return; return;
} }
break; break;
case 'perNHour': case 'perNHour':
if (item.hour < 0 || item.hour > 8784 || item.minute < 0 || item.minute > 59) { if (item.hour < 0 || item.hour > 8784 || item.minute < 0 || item.minute > 59) {
callback(new Error(i18n.global.t('cronjob.specErr'))); callback(new Error(i18n.global.t('toolbox.clam.specErr')));
return; return;
} }
break; break;
case 'perHour': case 'perHour':
if (item.minute < 0 || item.minute > 59) { if (item.minute < 0 || item.minute > 59) {
callback(new Error(i18n.global.t('cronjob.specErr'))); callback(new Error(i18n.global.t('toolbox.clam.specErr')));
return; return;
} }
case 'perNMinute': case 'perNMinute':
if (item.minute < 0 || item.minute > 527040) { if (item.minute < 0 || item.minute > 527040) {
callback(new Error(i18n.global.t('cronjob.specErr'))); callback(new Error(i18n.global.t('toolbox.clam.specErr')));
return; return;
} }
break; break;
case 'perNSecond': case 'perNSecond':
if (item.second < 0 || item.second > 31622400) { if (item.second < 0 || item.second > 31622400) {
callback(new Error(i18n.global.t('cronjob.specErr'))); callback(new Error(i18n.global.t('toolbox.clam.specErr')));
return; return;
} }
break; break;

Loading…
Cancel
Save