From 4437322a16f9527f336eb5ab1b89ed118cc5cb8f Mon Sep 17 00:00:00 2001 From: chejiangyi <4251595> Date: Fri, 6 Jan 2023 19:46:43 +0800 Subject: [PATCH] =?UTF-8?q?bug=20=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bsf/health/filter/WebControllerAspect.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/free-bsf-health/src/main/java/com/free/bsf/health/filter/WebControllerAspect.java b/free-bsf-health/src/main/java/com/free/bsf/health/filter/WebControllerAspect.java index 79779b6..a4f923a 100644 --- a/free-bsf-health/src/main/java/com/free/bsf/health/filter/WebControllerAspect.java +++ b/free-bsf-health/src/main/java/com/free/bsf/health/filter/WebControllerAspect.java @@ -55,12 +55,12 @@ public class WebControllerAspect { return result; } - private String inputParams() { - val request = WebUtils.getRequest(); - if(request!=null) { - return StringUtils.nullToEmpty(JsonUtils.serialize(request.getParameterMap())); + private String inputParams(ProceedingJoinPoint joinPoint) { + try{ + return JsonUtils.serialize(joinPoint.getArgs()); + }catch (Exception e){ + return ""; } - return ""; } //sql 执行超时检查 private void checkUrlExecuteTime(ProceedingJoinPoint joinPoint, long timeSpan){ @@ -69,7 +69,7 @@ public class WebControllerAspect { String uri = request.getRequestURI(); if(StringUtils.hitCondition(WarnProperties.getWarnUrlExecuteExclude().toLowerCase(),uri.toLowerCase())) return; - String inPutParam = inputParams(); + String inPutParam = inputParams(joinPoint); AbstractCollectTask.notifyMessage(EnumWarnType.WARN, "url执行超时", String.format("[耗时]%sms,[url]%s,[入参]%s",timeSpan,uri,inPutParam)); } } @@ -80,7 +80,7 @@ public class WebControllerAspect { String uri = request.getRequestURI(); if(StringUtils.hitCondition(WarnProperties.getWarnUrlExecuteExclude().toLowerCase(),uri.toLowerCase())) return; - String inPutParam = inputParams(); + String inPutParam = inputParams(joinPoint); AbstractCollectTask.notifyMessage(EnumWarnType.WARN, "url执行错误", String.format("[url]%s,[入参]%s,[错误]%s",uri,inPutParam, ExceptionUtils.getDetailMessage(e))); } } -- Gitee