From 848f507b13d00c29037ecfd08f6f6d06a53a7d9a Mon Sep 17 00:00:00 2001 From: dinggang <2498628697@qq.com> Date: Wed, 15 Jun 2022 14:11:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9F=A5=E7=9C=8B=E8=AF=B7=E6=B1=82ip?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/renren/interceptor/AuthorizationInterceptor.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/renren-api/src/main/java/io/renren/interceptor/AuthorizationInterceptor.java b/renren-api/src/main/java/io/renren/interceptor/AuthorizationInterceptor.java index 1c5c4b69..e9fd4266 100644 --- a/renren-api/src/main/java/io/renren/interceptor/AuthorizationInterceptor.java +++ b/renren-api/src/main/java/io/renren/interceptor/AuthorizationInterceptor.java @@ -6,6 +6,8 @@ import io.renren.common.exception.RenException; import io.renren.entity.TokenEntity; import io.renren.service.TokenService; import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import org.springframework.web.method.HandlerMethod; @@ -24,10 +26,12 @@ public class AuthorizationInterceptor extends HandlerInterceptorAdapter { private TokenService tokenService; public static final String USER_KEY = "userId"; + public static final Logger LOGGER = LoggerFactory.getLogger(AuthorizationInterceptor.class); @Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { Login annotation; + LOGGER.info("请求地址:{}", request.getRemoteAddr()); if(handler instanceof HandlerMethod) { annotation = ((HandlerMethod) handler).getMethodAnnotation(Login.class); }else{