Selaa lähdekoodia

操作日志记录DELETE请求参数

RuoYi 1 vuosi sitten
vanhempi
commit
e6796c0954

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

@@ -164,10 +164,9 @@ public class LogAspect
164 164
      */
165 165
     private void setRequestValue(JoinPoint joinPoint, SysOperLog operLog, String[] excludeParamNames) throws Exception
166 166
     {
167
-        String requestMethod = operLog.getRequestMethod();
168 167
         Map<?, ?> paramsMap = ServletUtils.getParamMap(ServletUtils.getRequest());
169
-        if (StringUtils.isEmpty(paramsMap)
170
-                && (HttpMethod.PUT.name().equals(requestMethod) || HttpMethod.POST.name().equals(requestMethod)))
168
+        String requestMethod = operLog.getRequestMethod();
169
+        if (StringUtils.isEmpty(paramsMap) && StringUtils.equalsAny(requestMethod, HttpMethod.PUT.name(), HttpMethod.POST.name(), HttpMethod.DELETE.name()))
171 170
         {
172 171
             String params = argsArrayToString(joinPoint.getArgs(), excludeParamNames);
173 172
             operLog.setOperParam(StringUtils.substring(params, 0, 2000));