|
|
|
@@ -1,6 +1,7 @@ |
|
|
|
package com.imitate.web.aspect; |
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSON; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.imitate.common.util.HttpContextUtils; |
|
|
|
import com.imitate.common.util.IpUtil; |
|
|
|
import com.imitate.web.persistence.beans.SysLog; |
|
|
|
@@ -16,6 +17,7 @@ import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.context.ApplicationEventPublisher; |
|
|
|
import org.springframework.core.Ordered; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
import org.springframework.validation.BindingResult; |
|
|
|
import org.springframework.web.bind.annotation.RequestMapping; |
|
|
|
import org.springframework.web.multipart.MultipartFile; |
|
|
|
|
|
|
|
@@ -93,12 +95,16 @@ public class ParamsOutAspect implements Ordered { |
|
|
|
Map<String, Object> paramsMap = new HashMap<>(); |
|
|
|
if (params != null) { |
|
|
|
for (int i = 0; i < params.length; i++) { |
|
|
|
if ((!(args[i] instanceof HttpServletRequest) && !(args[i] instanceof HttpServletResponse)) && !(args[i] instanceof MultipartFile)) { |
|
|
|
if ((!(args[i] instanceof HttpServletRequest) |
|
|
|
&& !(args[i] instanceof HttpServletResponse)) |
|
|
|
&& !(args[i] instanceof MultipartFile) |
|
|
|
&& !(args[i] instanceof BindingResult) |
|
|
|
) { |
|
|
|
paramsMap.put(params[i], args[i]); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
sysLog.setParams(JSON.toJSONString(paramsMap)); |
|
|
|
sysLog.setParams(JSONObject.toJSONString(paramsMap)); |
|
|
|
|
|
|
|
//记录耗时 |
|
|
|
int cost = Duration.between(startTime, Instant.now()).getNano() / 1000000; |
|
|
|
|