diff --git a/src/locales/en-US.json b/src/locales/en-US.json
index 3fc2f8c6..6d0c8f44 100644
--- a/src/locales/en-US.json
+++ b/src/locales/en-US.json
@@ -459,6 +459,7 @@
"新增定时规则": "Add Timing Rules",
"运行任务前执行的命令,比如 cp/mv/python3 xxx.py/node xxx.js": "Run commands before executing the task, e.g., cp/mv/python3 xxx.py/node xxx.js",
"运行任务后执行的命令,比如 cp/mv/python3 xxx.py/node xxx.js": "Run commands after executing the task, e.g., cp/mv/python3 xxx.py/node xxx.js",
- "请输入运行任务前要执行的命令": "Please enter the command to run before executing the task",
- "请输入运行任务后要执行的命令": "Please enter the command to run after executing the task"
+ "请输入运行任务前要执行的命令,不能包含 task 命令": "Please enter the command to run before executing the task, cannot contain task commands",
+ "请输入运行任务后要执行的命令,不能包含 task 命令": "Please enter the command to run after executing the task, cannot contain task commands",
+ "不能包含 task 命令": "Cannot contain task commands"
}
diff --git a/src/locales/zh-CN.json b/src/locales/zh-CN.json
index 65d85d14..541f23db 100644
--- a/src/locales/zh-CN.json
+++ b/src/locales/zh-CN.json
@@ -459,6 +459,7 @@
"新增定时规则": "新增定时规则",
"运行任务前执行的命令,比如 cp/mv/python3 xxx.py/node xxx.js": "运行任务前执行的命令,比如 cp/mv/python3 xxx.py/node xxx.js",
"运行任务后执行的命令,比如 cp/mv/python3 xxx.py/node xxx.js": "运行任务后执行的命令,比如 cp/mv/python3 xxx.py/node xxx.js",
- "请输入运行任务前要执行的命令": "请输入运行任务前要执行的命令",
- "请输入运行任务后要执行的命令": "请输入运行任务后要执行的命令"
+ "请输入运行任务前要执行的命令,不能包含 task 命令": "请输入运行任务前要执行的命令,不能包含 task 命令",
+ "请输入运行任务后要执行的命令,不能包含 task 命令": "请输入运行任务后要执行的命令,不能包含 task 命令",
+ "不能包含 task 命令": "不能包含 task 命令"
}
diff --git a/src/pages/crontab/modal.tsx b/src/pages/crontab/modal.tsx
index 7f5924a9..a950dc43 100644
--- a/src/pages/crontab/modal.tsx
+++ b/src/pages/crontab/modal.tsx
@@ -153,11 +153,23 @@ const CronModal = ({
tooltip={intl.get(
'运行任务前执行的命令,比如 cp/mv/python3 xxx.py/node xxx.js',
)}
+ rules={[
+ {
+ validator(rule, value) {
+ if (value.includes(' task ') || value.startsWith('task ')) {
+ return Promise.reject(intl.get('不能包含 task 命令'));
+ }
+ return Promise.resolve();
+ },
+ },
+ ]}
>