From 27fb5ec5798a4dd30ba437a9a922a2d78544e301 Mon Sep 17 00:00:00 2001 From: 935090232@qq.com <ak473600000> Date: Sun, 20 Feb 2022 22:56:20 +0800 Subject: [PATCH] 配置文件改造 --- zq-erp/src/main/java/com/matrix/core/exception/GlobleExceptionResolver.java | 14 +++++++++++--- 1 files changed, 11 insertions(+), 3 deletions(-) diff --git a/zq-erp/src/main/java/com/matrix/core/exception/GlobleExceptionResolver.java b/zq-erp/src/main/java/com/matrix/core/exception/GlobleExceptionResolver.java index 2ff87a7..f8037ae 100644 --- a/zq-erp/src/main/java/com/matrix/core/exception/GlobleExceptionResolver.java +++ b/zq-erp/src/main/java/com/matrix/core/exception/GlobleExceptionResolver.java @@ -7,6 +7,8 @@ import com.matrix.system.common.bean.ProjException; import com.matrix.system.common.bean.SysUsers; import com.matrix.system.common.dao.ProjExceptionDao; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.web.servlet.HandlerExceptionResolver; import org.springframework.web.servlet.ModelAndView; @@ -26,6 +28,13 @@ public class GlobleExceptionResolver implements HandlerExceptionResolver { private static final String TRUE = "true"; + + @Value("${is_open_exception_report}") + String isOpenExceptionReport; + + + @Value("${showExcptionUrl}") + String showExcptionUrl; /** @@ -78,15 +87,14 @@ * @email 935090232@qq.com * @date 2018年5月9日 */ - public static void sendNoticeToAdmin(Exception ex, String mdc, String requestUrl) { + public void sendNoticeToAdmin(Exception ex, String mdc, String requestUrl) { String simpleMsg = ex.getMessage(); if (!EXCLUDE_EXCEPTION.contains(simpleMsg)) { - String isOpenDingdingExceptionNotice = PropertiesUtil.getString("is_open_exception_report"); - String showExcptionUrl = PropertiesUtil.getString("showExcptionUrl"); + String isOpenDingdingExceptionNotice =isOpenExceptionReport; if (isOpenDingdingExceptionNotice != null && TRUE.equals(isOpenDingdingExceptionNotice)) { -- Gitblit v1.9.1