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 79779b680c28b5ec1fa782b35f5e7143736aac8e..a4f923aeb6b39076f4f41fadd35df989d2d81c9b 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))); } }