From fa1ad97aed21bc29ef081bec6e6402f4b65890c9 Mon Sep 17 00:00:00 2001 From: wxz Date: Thu, 8 Jul 2021 12:22:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=9AWebMvcCOnfig?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=97=A5=E5=BF=97=E6=A0=BC=E5=BC=8F=E8=BD=AC?= =?UTF-8?q?=E6=8D=A2=E5=99=A8=E4=B8=BAyyyy-MM-dd=20HH:mnm:ss?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commons/tools/exception/ExceptionUtils.java | 12 +++++++++++- .../commons/tools/security/config/WebMvcConfig.java | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/ExceptionUtils.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/ExceptionUtils.java index a5e559cbfa..3064252ce7 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/ExceptionUtils.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/exception/ExceptionUtils.java @@ -25,12 +25,22 @@ public class ExceptionUtils { * @return 返回异常信息 */ public static String getErrorStackTrace(Exception ex){ + return getErrorStackTraceOfThrowable(ex); + } + + /** + * @Description Throwable级别的错误信息 + * @return + * @author wxz + * @date 2021.07.07 14:37 + */ + public static String getErrorStackTraceOfThrowable(Throwable t) { StringWriter sw = null; PrintWriter pw = null; try { sw = new StringWriter(); pw = new PrintWriter(sw, true); - ex.printStackTrace(pw); + t.printStackTrace(pw); }finally { try { if(pw != null) { diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/config/WebMvcConfig.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/config/WebMvcConfig.java index 549530747b..d1af449333 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/config/WebMvcConfig.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/security/config/WebMvcConfig.java @@ -66,7 +66,7 @@ public class WebMvcConfig implements WebMvcConfigurer { //日期格式转换 mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - mapper.setDateFormat(new SimpleDateFormat(DateUtils.DATE_TIME_PATTERN_END_WITH_MINUTE)); + mapper.setDateFormat(new SimpleDateFormat(DateUtils.DATE_TIME_PATTERN)); mapper.setTimeZone(TimeZone.getTimeZone("GMT+8")); //Long类型转String类型