查看请求ip
This commit is contained in:
parent
c31ea91477
commit
848f507b13
|
@ -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{
|
||||
|
|
Loading…
Reference in New Issue