From 58a001536b6d028546386b774e9d042252cbe772 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BF=9E=E5=AE=9D=E5=B1=B1?= <1253070437@qq.com> Date: Fri, 24 May 2024 01:56:00 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=9B=B4=E6=96=B0=E3=80=91=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E6=97=A5=E5=BF=97=E5=AD=98=E5=82=A8url=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vip/xiaonuo/dev/modular/log/util/DevLogUtil.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/snowy-plugin/snowy-plugin-dev/src/main/java/vip/xiaonuo/dev/modular/log/util/DevLogUtil.java b/snowy-plugin/snowy-plugin-dev/src/main/java/vip/xiaonuo/dev/modular/log/util/DevLogUtil.java index a1cdb98d..5525b495 100644 --- a/snowy-plugin/snowy-plugin-dev/src/main/java/vip/xiaonuo/dev/modular/log/util/DevLogUtil.java +++ b/snowy-plugin/snowy-plugin-dev/src/main/java/vip/xiaonuo/dev/modular/log/util/DevLogUtil.java @@ -45,6 +45,8 @@ public class DevLogUtil { */ public static void executeOperationLog(CommonLog commonLog, String userName, JoinPoint joinPoint, String resultJson) { HttpServletRequest request = CommonServletUtil.getRequest(); + String requestURI = request.getRequestURI(); + String method = request.getRequestURI(); DevLog devLog = genBasOpLog(); ThreadUtil.execute(() -> { devLog.setCategory(DevLogCategoryEnum.OPERATE.getValue()); @@ -52,8 +54,8 @@ public class DevLogUtil { devLog.setExeStatus(DevLogExeStatusEnum.SUCCESS.getValue()); devLog.setClassName(joinPoint.getTarget().getClass().getName()); devLog.setMethodName(joinPoint.getSignature().getName()); - devLog.setReqMethod(request.getMethod()); - devLog.setReqUrl(request.getRequestURI()); + devLog.setReqMethod(method); + devLog.setReqUrl(requestURI); devLog.setParamJson(CommonJoinPointUtil.getArgsJsonString(joinPoint)); devLog.setResultJson(resultJson); devLog.setOpTime(DateTime.now()); @@ -71,6 +73,8 @@ public class DevLogUtil { */ public static void executeExceptionLog(CommonLog commonLog, String userName, JoinPoint joinPoint, Exception exception) { HttpServletRequest request = CommonServletUtil.getRequest(); + String requestURI = request.getRequestURI(); + String method = request.getRequestURI(); DevLog devLog = genBasOpLog(); ThreadUtil.execute(() -> { devLog.setCategory(DevLogCategoryEnum.EXCEPTION.getValue()); @@ -79,8 +83,8 @@ public class DevLogUtil { devLog.setExeMessage(ExceptionUtil.stacktraceToString(exception, Integer.MAX_VALUE)); devLog.setClassName(joinPoint.getTarget().getClass().getName()); devLog.setMethodName(joinPoint.getSignature().getName()); - devLog.setReqMethod(request.getMethod()); - devLog.setReqUrl(request.getRequestURI()); + devLog.setReqMethod(method); + devLog.setReqUrl(requestURI); devLog.setParamJson(CommonJoinPointUtil.getArgsJsonString(joinPoint)); devLog.setOpTime(DateTime.now()); devLog.setOpUser(userName);