Bläddra i källkod

优化修改密码日志存储明文问题(I6ESO9)

RuoYi 3 år sedan
förälder
incheckning
775234dabe

+ 3 - 2
ruoyi-common/ruoyi-common-log/src/main/java/com/ruoyi/common/log/aspect/LogAspect.java

@@ -165,14 +165,15 @@ public class LogAspect
165 165
     private void setRequestValue(JoinPoint joinPoint, SysOperLog operLog, String[] excludeParamNames) throws Exception
166 166
     {
167 167
         String requestMethod = operLog.getRequestMethod();
168
-        if (HttpMethod.PUT.name().equals(requestMethod) || HttpMethod.POST.name().equals(requestMethod))
168
+        Map<?, ?> paramsMap = ServletUtils.getParamMap(ServletUtils.getRequest());
169
+        if (StringUtils.isEmpty(paramsMap)
170
+                && (HttpMethod.PUT.name().equals(requestMethod) || HttpMethod.POST.name().equals(requestMethod)))
169 171
         {
170 172
             String params = argsArrayToString(joinPoint.getArgs(), excludeParamNames);
171 173
             operLog.setOperParam(StringUtils.substring(params, 0, 2000));
172 174
         }
173 175
         else
174 176
         {
175
-            Map<?, ?> paramsMap = ServletUtils.getParamMap(ServletUtils.getRequest());
176 177
             operLog.setOperParam(StringUtils.substring(JSON.toJSONString(paramsMap, excludePropertyPreFilter(excludeParamNames)), 0, 2000));
177 178
         }
178 179
     }