|
@@ -19,10 +19,11 @@ import com.ruoyi.common.annotation.Log;
|
|
|
import com.ruoyi.common.core.domain.model.LoginUser;
|
|
|
import com.ruoyi.common.enums.BusinessStatus;
|
|
|
import com.ruoyi.common.enums.HttpMethod;
|
|
|
+import com.ruoyi.common.filter.PropertyPreExcludeFilter;
|
|
|
+import com.ruoyi.common.utils.SecurityUtils;
|
|
|
import com.ruoyi.common.utils.ServletUtils;
|
|
|
import com.ruoyi.common.utils.StringUtils;
|
|
|
import com.ruoyi.common.utils.ip.IpUtils;
|
|
|
-import com.ruoyi.common.utils.SecurityUtils;
|
|
|
import com.ruoyi.framework.manager.AsyncManager;
|
|
|
import com.ruoyi.framework.manager.factory.AsyncFactory;
|
|
|
import com.ruoyi.system.domain.SysOperLog;
|
|
@@ -38,6 +39,9 @@ public class LogAspect
|
|
|
{
|
|
|
private static final Logger log = LoggerFactory.getLogger(LogAspect.class);
|
|
|
|
|
|
+ /** 排除敏感属性字段 */
|
|
|
+ public static final String[] EXCLUDE_PROPERTIES = { "password", "oldPassword", "newPassword", "confirmPassword" };
|
|
|
+
|
|
|
/**
|
|
|
* 处理完请求后执行
|
|
|
*
|
|
@@ -168,7 +172,7 @@ public class LogAspect
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
- Object jsonObj = JSON.toJSON(o);
|
|
|
+ String jsonObj = JSON.toJSONString(o, excludePropertyPreFilter());
|
|
|
params += jsonObj.toString() + " ";
|
|
|
}
|
|
|
catch (Exception e)
|
|
@@ -181,6 +185,14 @@ public class LogAspect
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * 忽略敏感属性
|
|
|
+ */
|
|
|
+ public PropertyPreExcludeFilter excludePropertyPreFilter()
|
|
|
+ {
|
|
|
+ return new PropertyPreExcludeFilter().addExcludes(EXCLUDE_PROPERTIES);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* 判断是否需要过滤的对象。
|
|
|
*
|
|
|
* @param o 对象信息。
|