Skip to content

Commit

Permalink
修复定时任务任务前后命令校验
Browse files Browse the repository at this point in the history
  • Loading branch information
whyour committed Oct 11, 2023
1 parent b6376ed commit b8a9b26
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/pages/crontab/modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,10 @@ const CronModal = ({
rules={[
{
validator(rule, value) {
if (value.includes(' task ') || value.startsWith('task ')) {
if (
value &&
(value.includes(' task ') || value.startsWith('task '))
) {
return Promise.reject(intl.get('不能包含 task 命令'));
}
return Promise.resolve();
Expand All @@ -181,7 +184,10 @@ const CronModal = ({
rules={[
{
validator(rule, value) {
if (value.includes(' task ') || value.startsWith('task ')) {
if (
value &&
(value.includes(' task ') || value.startsWith('task '))
) {
return Promise.reject(intl.get('不能包含 task 命令'));
}
return Promise.resolve();
Expand Down

0 comments on commit b8a9b26

Please sign in to comment.