From 4df2b72b30d16712254ab82376eff0f5f5ff4c1e Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sun, 17 Apr 2022 10:35:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A3=80=E6=9F=A5=E5=AE=9A=E6=97=B6=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1bean=E6=89=80=E5=9C=A8=E5=8C=85=E5=90=8D=E6=98=AF?= =?UTF-8?q?=E5=90=A6=E4=B8=BA=E7=99=BD=E5=90=8D=E5=8D=95=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ruoyi-job/src/main/java/com/ruoyi/job/util/ScheduleUtils.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ruoyi-modules/ruoyi-job/src/main/java/com/ruoyi/job/util/ScheduleUtils.java b/ruoyi-modules/ruoyi-job/src/main/java/com/ruoyi/job/util/ScheduleUtils.java index d0881c2..72590b0 100644 --- a/ruoyi-modules/ruoyi-job/src/main/java/com/ruoyi/job/util/ScheduleUtils.java +++ b/ruoyi-modules/ruoyi-job/src/main/java/com/ruoyi/job/util/ScheduleUtils.java @@ -14,6 +14,7 @@ import com.ruoyi.common.core.constant.Constants; import com.ruoyi.common.core.constant.ScheduleConstants; import com.ruoyi.common.core.exception.job.TaskException; import com.ruoyi.common.core.exception.job.TaskException.Code; +import com.ruoyi.common.core.utils.SpringUtils; import com.ruoyi.common.core.utils.StringUtils; import com.ruoyi.job.domain.SysJob; @@ -127,6 +128,7 @@ public class ScheduleUtils { return StringUtils.containsAnyIgnoreCase(invokeTarget, Constants.JOB_WHITELIST_STR); } - return true; + Object obj = SpringUtils.getBean(StringUtils.split(invokeTarget, ".")[0]); + return StringUtils.containsAnyIgnoreCase(obj.getClass().getPackage().getName(), Constants.JOB_WHITELIST_STR); } -} +} \ No newline at end of file