Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
RuoYi Vue
Commits
cc4c52c9
Commit
cc4c52c9
authored
Nov 01, 2021
by
RuoYi
Browse files
任务屏蔽违规字符
parent
bd09e5b1
Changes
2
Hide whitespace changes
Inline
Side-by-side
ruoyi-common/src/main/java/com/ruoyi/common/constant/Constants.java
View file @
cc4c52c9
...
...
@@ -148,4 +148,10 @@ public class Constants
* LDAP 远程方法调用
*/
public
static
final
String
LOOKUP_LDAP
=
"ldap://"
;
}
/**
* 定时任务违规的字符
*/
public
static
final
String
[]
JOB_ERROR_STR
=
{
"java.net.URL"
,
"javax.naming.InitialContext"
,
"org.yaml.snakeyaml"
,
"org.springframework.jndi"
};
}
\ No newline at end of file
ruoyi-quartz/src/main/java/com/ruoyi/quartz/controller/SysJobController.java
View file @
cc4c52c9
...
...
@@ -96,6 +96,10 @@ public class SysJobController extends BaseController
{
return
error
(
"新增任务'"
+
job
.
getJobName
()
+
"'失败,目标字符串不允许'http(s)//'调用"
);
}
else
if
(
StringUtils
.
containsAnyIgnoreCase
(
job
.
getInvokeTarget
(),
Constants
.
JOB_ERROR_STR
))
{
return
error
(
"新增任务'"
+
job
.
getJobName
()
+
"'失败,目标字符串存在违规"
);
}
job
.
setCreateBy
(
getUsername
());
return
toAjax
(
jobService
.
insertJob
(
job
));
}
...
...
@@ -124,6 +128,10 @@ public class SysJobController extends BaseController
{
return
error
(
"修改任务'"
+
job
.
getJobName
()
+
"'失败,目标字符串不允许'http(s)//'调用"
);
}
else
if
(
StringUtils
.
containsAnyIgnoreCase
(
job
.
getInvokeTarget
(),
Constants
.
JOB_ERROR_STR
))
{
return
error
(
"修改任务'"
+
job
.
getJobName
()
+
"'失败,目标字符串存在违规"
);
}
job
.
setUpdateBy
(
getUsername
());
return
toAjax
(
jobService
.
updateJob
(
job
));
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment