🎨 优化代码
This commit is contained in:
parent
f3a823c773
commit
6c3f2d9844
@ -1,5 +1,6 @@
|
||||
package com.rymcu.forest.config;
|
||||
|
||||
import com.rymcu.forest.util.Utils;
|
||||
import org.aspectj.lang.JoinPoint;
|
||||
import org.aspectj.lang.annotation.AfterReturning;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
@ -48,14 +49,12 @@ public class WebLogAspect {
|
||||
|
||||
// 接收到请求,记录请求内容
|
||||
logger.info("WebLogAspect.doBefore()");
|
||||
ServletRequestAttributes attributes =
|
||||
(ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||
HttpServletRequest request = attributes.getRequest();
|
||||
|
||||
// 记录下请求内容
|
||||
logger.info("URL : " + request.getRequestURL().toString());
|
||||
logger.info("HTTP_METHOD : " + request.getMethod());
|
||||
logger.info("IP : " + request.getRemoteAddr());
|
||||
logger.info("IP : " + Utils.getIpAddress(request));
|
||||
logger.info(
|
||||
"CLASS_METHOD : "
|
||||
+ joinPoint.getSignature().getDeclaringTypeName()
|
||||
|
@ -42,6 +42,7 @@ public class Utils {
|
||||
|
||||
/**
|
||||
* 一般检查工具密码比对 add by xlf 2018-11-8
|
||||
*
|
||||
* @param pwd
|
||||
* @param enpwd 加密的密码
|
||||
* @return
|
||||
@ -80,9 +81,10 @@ public class Utils {
|
||||
|
||||
/**
|
||||
* 获取配置文件内属性
|
||||
*
|
||||
* @param key 键值
|
||||
* @return 属性值
|
||||
* */
|
||||
*/
|
||||
public static String getProperty(String key) {
|
||||
return env.getProperty(key);
|
||||
}
|
||||
@ -202,7 +204,7 @@ public class Utils {
|
||||
ip = ip.substring(0, ip.indexOf(",")).trim();
|
||||
}
|
||||
|
||||
return ip;
|
||||
return "0:0:0:0:0:0:0:1".equals(ip) ? "127.0.0.1" : ip;
|
||||
}
|
||||
|
||||
public static Map getNotificationDTOsGlobalResult(PageInfo<NotificationDTO> pageInfo) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user