From a46e5460a6c425366896ca52f79672092b2e0afd Mon Sep 17 00:00:00 2001 From: RuoYi Date: Tue, 19 Nov 2019 15:16:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A5=E5=BF=97=E8=AE=B0=E5=BD=95=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E7=89=B9=E6=AE=8A=E5=AF=B9=E8=B1=A1=EF=BC=8C=E9=98=B2?= =?UTF-8?q?=E6=AD=A2=E8=BD=AC=E6=8D=A2=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/framework/aspectj/LogAspect.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/ruoyi/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java b/ruoyi/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java index 8bb20741..29a1c97e 100644 --- a/ruoyi/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java +++ b/ruoyi/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java @@ -2,6 +2,8 @@ package com.ruoyi.framework.aspectj; import java.lang.reflect.Method; import java.util.Map; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; import org.aspectj.lang.JoinPoint; import org.aspectj.lang.Signature; import org.aspectj.lang.annotation.AfterReturning; @@ -192,7 +194,7 @@ public class LogAspect { for (int i = 0; i < paramsArray.length; i++) { - if (!(paramsArray[i] instanceof MultipartFile)) + if (!isFilterObject(paramsArray[i])) { Object jsonObj = JSON.toJSON(paramsArray[i]); params += jsonObj.toString() + " "; @@ -201,4 +203,15 @@ public class LogAspect } return params.trim(); } + + /** + * 判断是否需要过滤的对象。 + * + * @param o 对象信息。 + * @return 如果是需要过滤的对象,则返回true;否则返回false。 + */ + public boolean isFilterObject(final Object o) + { + return o instanceof MultipartFile || o instanceof HttpServletRequest || o instanceof HttpServletResponse; + } }