作者 RuoYi

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

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