From 845855c7b411622b93eff866b54cd37983f53797 Mon Sep 17 00:00:00 2001
From: Fancy <Fancy.fx@outlook.com>
Date: 星期五, 13 十二月 2024 09:55:34 +0800
Subject: [PATCH] change wx name
---
pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/aop/LogAspect.java | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/aop/LogAspect.java b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/aop/LogAspect.java
index 1086ddc..fbe0486 100644
--- a/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/aop/LogAspect.java
+++ b/pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/aop/LogAspect.java
@@ -34,6 +34,8 @@
public String SsoCurUserUrl ;
private LogService logSv;
+ @Value("${pms.global.dev}")
+ public String isDevStage ;//鏄惁涓哄紑鍙戦樁娈�
@Autowired
public void setLogSv(LogService logSv){
this.logSv = logSv;
@@ -46,11 +48,13 @@
@AfterReturning(pointcut = "@annotation(com.dy.pmsGlobal.aop.Log)", returning = "result")
public void logAfterReturning(JoinPoint joinPoint, BaseResponse result) {
+ if(isDevStage != null && !isDevStage.trim().equals("") && isDevStage.trim().equalsIgnoreCase("true")){
+ return;
+ }
try{
// 鑾峰彇鐢ㄦ埛淇℃伅
BaUser user = (BaUser)getCurUser(result);
if(user!=null && user.id !=null && !StringUtils.isNullOrEmpty(user.name)){
- Long operator = user.id;
// 鑾峰彇鏂规硶鐨勪腑鏂囨弿杩�
MethodSignature sign = (MethodSignature) joinPoint.getSignature();
Log logDesc = sign.getMethod().getAnnotation(Log.class);
@@ -58,7 +62,11 @@
// 鑾峰彇IP鍦板潃
String ip = getRemoteHost();
// 璁板綍鏃ュ織
- logSv.save(operator, operationName,ip,result.getCode(),result.getMsg());
+ //msg 鏂规硶鍚� + 鍙傛暟鍊� + 杩斿洖鍊�
+// Stream.of(joinPoint.getArgs()).forEach(System.out::println);
+// String args = JSONObject.toJSONString(joinPoint.getArgs());
+ //String args1 = Arrays.toString(joinPoint.getArgs());
+ logSv.save(user.id,user.name, operationName,ip,result.getCode(),result.getMsg());
}
}catch (Exception e){
log.error("璁板綍鏃ュ織寮傚父:"+e.getMessage());
--
Gitblit v1.8.0