|
@@ -1,15 +1,12 @@
|
|
|
package com.yonge.log.interceptor;
|
|
|
|
|
|
import java.io.IOException;
|
|
|
-import java.lang.reflect.Array;
|
|
|
import java.nio.charset.Charset;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.*;
|
|
|
-
|
|
|
import javax.servlet.ServletException;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
-
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.apache.commons.io.IOUtils;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
@@ -81,6 +78,8 @@ public class AuditLogInterceptor extends HandlerInterceptorAdapter {
|
|
|
ignoreLogUrl.add("find");
|
|
|
ignoreLogUrl.add("list");
|
|
|
ignoreLogUrl.add("detail");
|
|
|
+ ignoreLogUrl.add("hasIndexErrData");
|
|
|
+ ignoreLogUrl.add("newIndex");
|
|
|
}
|
|
|
for (String e : ignoreLogUrl) {
|
|
|
if(substring.contains(e)){
|
|
@@ -109,28 +108,13 @@ public class AuditLogInterceptor extends HandlerInterceptorAdapter {
|
|
|
}
|
|
|
// 操作人
|
|
|
auditLog.setUsername(username);
|
|
|
+ auditLog.setUserId(userId);
|
|
|
auditLog.setOperateTime(sdf.format(new Date()));
|
|
|
auditLogService.insert(auditLog);
|
|
|
}
|
|
|
- Map<String, Object> params = WebUtil.getParameterMap(request);
|
|
|
- if (params == null || params.size() == 0) {
|
|
|
- auditLog.setInputParams(IOUtils.toString(request.getInputStream(), Charset.defaultCharset()));
|
|
|
- } else {
|
|
|
- auditLog.setInputParams(JsonUtil.toJSONString(WebUtil.getParameterMap(request)));
|
|
|
- }
|
|
|
- // 操作人
|
|
|
- auditLog.setUsername(username);
|
|
|
- auditLog.setUserId(userId);
|
|
|
- auditLog.setOperateTime(sdf.format(new Date()));
|
|
|
- auditLogService.insert(auditLog);
|
|
|
- }
|
|
|
-
|
|
|
- public void setUsername(String username) {
|
|
|
- }
|
|
|
|
|
|
public void setUsername(String username,Integer userId) {
|
|
|
this.username = username;
|
|
|
this.userId = userId;
|
|
|
}
|
|
|
-
|
|
|
}
|