From 00cf38f9ec036d4f1cc201182a05a484631ea75d Mon Sep 17 00:00:00 2001 From: = Date: Fri, 12 Jun 2020 11:22:42 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B7=B3=E8=BF=87=E5=90=8E=E9=97=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/epmet/openapi/scan/config/WebAppConfig.java | 2 +- .../epmet/openapi/scan/interceptor/ScanApiAuthInterceptor.java | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/config/WebAppConfig.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/config/WebAppConfig.java index 6ec719587e..c955a7f555 100644 --- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/config/WebAppConfig.java +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/config/WebAppConfig.java @@ -25,7 +25,7 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; public void addInterceptors(InterceptorRegistry registry) { registry.addInterceptor(scanApiAuthInterceptor)//添加拦截器 .addPathPatterns("/**") //拦截所有请求 - .excludePathPatterns("/opback/addWhite*");//对应的不拦截的请求 + .excludePathPatterns("/opback/**");//对应的不拦截的请求 } } diff --git a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/interceptor/ScanApiAuthInterceptor.java b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/interceptor/ScanApiAuthInterceptor.java index 6ce851a45e..5df7bbb79e 100644 --- a/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/interceptor/ScanApiAuthInterceptor.java +++ b/epmet-openapi/epmet-openapi-scan/src/main/java/com/epmet/openapi/scan/interceptor/ScanApiAuthInterceptor.java @@ -31,6 +31,7 @@ public class ScanApiAuthInterceptor implements HandlerInterceptor { @Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { String ip = IpUtils.getIpAddr(request); + log.info("preHandle requestUrl",request.getRequestURL()); SetOperations setOperations = redisTemplate.opsForSet(); if (!setOperations.isMember(RedisKeys.getWhiteList(), ip)) { log.warn("preHandle ip:{} is not in whitelist", ip);