Commit 69409ec4 authored by lee_mingzhu's avatar lee_mingzhu

删除切面逻辑,只打印获取到的用户请求IP

parent 3cb17a8b
......@@ -14,6 +14,7 @@ import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;
import javax.servlet.http.HttpServletRequest;
import javax.xml.crypto.dsig.keyinfo.PGPData;
/**
* Created by 11 on 2017/3/23.
......@@ -32,7 +33,10 @@ public class IpValidatorAdvisor {
@Around("needIpValidate()")
private Object doCapchaValidate(ProceedingJoinPoint pjp) throws Throwable {
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
HttpServletRequest request = ((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getRequest();
String ip = IPUtil.getRemoteIP(request);
LOGGER.info("获取ip地址:" + ip);
/*HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
String ip = IPUtil.getRemoteIP(request);
if(accessable) {
return pjp.proceed();
......@@ -43,6 +47,7 @@ public class IpValidatorAdvisor {
LOGGER.error("非法ip:{}", ip);
return JsonResult.buildErrorStateResult("非法ip", null);
}
}
}*/
return pjp.proceed();
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment