From 4574296e4453f0cbb75a5fdb8bb39fa43c87297c Mon Sep 17 00:00:00 2001
From: Fancy <Fancy.fx@outlook.com>
Date: 星期四, 15 八月 2024 15:07:26 +0800
Subject: [PATCH] @param

---
 pms-parent/pms-global/src/main/java/com/dy/pmsGlobal/aop/LogAspect.java |    8 ++++++--
 1 files changed, 6 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..636e66c 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,7 @@
                 // 鑾峰彇IP鍦板潃
                 String ip = getRemoteHost();
                 // 璁板綍鏃ュ織
-                logSv.save(operator, operationName,ip,result.getCode(),result.getMsg());
+                logSv.save(user.id,user.name, operationName,ip,result.getCode(),result.getMsg());
             }
         }catch (Exception e){
             log.error("璁板綍鏃ュ織寮傚父:"+e.getMessage());

--
Gitblit v1.8.0