|
@@ -1,5 +1,6 @@
|
|
|
package com.fdkankan.scene.config;
|
|
|
|
|
|
+import java.net.InetAddress;
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.aspectj.lang.JoinPoint;
|
|
@@ -26,12 +27,11 @@ public class V4ControllerAspect {
|
|
|
// 获取方法参数
|
|
|
HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
|
|
|
// 请求的URL
|
|
|
- String requestURL = request.getRequestURL().toString();
|
|
|
String ip = getIpAddr(request);
|
|
|
- log.info(requestURL);
|
|
|
- log.info(ip);
|
|
|
- System.out.println(requestURL);
|
|
|
- System.out.println(ip);
|
|
|
+ log.info("客户端ip:{}", ip);
|
|
|
+ InetAddress localHost = InetAddress.getLocalHost();
|
|
|
+ String hostAddress = localHost.getHostAddress();
|
|
|
+ log.info("本地ip:{}", hostAddress);
|
|
|
}
|
|
|
|
|
|
/**
|