|
|
@@ -10,7 +10,6 @@ import org.springframework.http.MediaType;
|
|
|
import org.springframework.web.servlet.HandlerInterceptor;
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
import top.haijunit.common.utils.JsonUtils;
|
|
|
-import top.haijunit.common.utils.SpringUtils;
|
|
|
import top.haijunit.web.filter.RepeatedlyRequestWrapper;
|
|
|
|
|
|
import java.io.BufferedReader;
|
|
|
@@ -24,11 +23,11 @@ import java.util.Map;
|
|
|
@Slf4j
|
|
|
public class WebInvokeTimeInterceptor implements HandlerInterceptor {
|
|
|
|
|
|
- private final static String PRO_FILE = "prod";
|
|
|
|
|
|
@Override
|
|
|
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {
|
|
|
- if (!PRO_FILE.equals(SpringUtils.getActiveProfile())) {
|
|
|
+ String apiLog = System.getenv("api_log");
|
|
|
+ if (StrUtil.isNotBlank(apiLog)) {
|
|
|
String url = request.getMethod() + " " + request.getRequestURI();
|
|
|
// 打印请求参数
|
|
|
if (isJsonRequest(request)) {
|