From b1f4dc1d9ce79e70ce7f554ac68bca09e6b7f6fc Mon Sep 17 00:00:00 2001
From: Junjie <540245094@qq.com>
Date: 星期三, 29 五月 2024 14:08:24 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/common/config/AspectConfig.java |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/main/java/com/zy/common/config/AspectConfig.java b/src/main/java/com/zy/common/config/AspectConfig.java
index 64d95ff..ebd180a 100644
--- a/src/main/java/com/zy/common/config/AspectConfig.java
+++ b/src/main/java/com/zy/common/config/AspectConfig.java
@@ -41,7 +41,7 @@
     @Autowired
     private OperateLogService operateLogService;
 
-    @Pointcut("execution(* com.zy.asrs.controller..*.*(..))")
+    @Pointcut("execution(* com.zy.asrs.controller.*(..))")
     private void webLog() {
     }
 
@@ -49,6 +49,9 @@
             "||@within(org.springframework.stereotype.Controller)")
     public Object after(ProceedingJoinPoint joinPoint) throws Throwable{
         ServletRequestAttributes requestAttributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
+        if(requestAttributes != null){
+            return joinPoint.proceed();
+        }
         HttpServletRequest request = requestAttributes.getRequest();
         long start = System.currentTimeMillis();
         Object result = joinPoint.proceed(joinPoint.getArgs());
@@ -102,7 +105,6 @@
         operateLog.setRequest(JSONObject.toJSONString(filterArgs(joinPoint.getArgs())));
         operateLog.setResponse(JSONObject.toJSONString(result));
         operateLogService.insert(operateLog);
-        request.setAttribute("operateLog", operateLog);
     }
 
 }
\ No newline at end of file

--
Gitblit v1.9.1