From b77d09f258ef7d5458f61ff1a90d1a686cb2f181 Mon Sep 17 00:00:00 2001
From: Junjie <DELL@qq.com>
Date: 星期三, 14 一月 2026 14:24:47 +0800
Subject: [PATCH] #

---
 src/main/java/com/zy/common/config/AspectConfig.java |   17 +++++++++++++++--
 1 files changed, 15 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 3a72029..c0ba743 100644
--- a/src/main/java/com/zy/common/config/AspectConfig.java
+++ b/src/main/java/com/zy/common/config/AspectConfig.java
@@ -8,6 +8,7 @@
 import com.zy.asrs.entity.ApiLog;
 import com.zy.asrs.service.ApiLogService;
 import com.zy.common.annotations.OpenApiLog;
+import com.zy.system.timer.LicenseTimer;
 import lombok.extern.slf4j.Slf4j;
 import org.aspectj.lang.ProceedingJoinPoint;
 import org.aspectj.lang.annotation.Around;
@@ -36,6 +37,8 @@
 
     @Autowired
     private ApiLogService apiLogService;
+    @Autowired
+    private LicenseTimer licenseTimer;
 
     @Pointcut("execution(* com.zy.asrs.controller.*(..))")
     private void webLog() {
@@ -53,6 +56,13 @@
         Object result = null;
         Object errorResponse = null;
         try {
+            if (licenseTimer != null && !licenseTimer.getSystemSupport()) {
+                Object fail = R.error("璁稿彲璇佸け鏁�");
+                if (annotation != null && !Cools.isEmpty(annotation.memo())) {
+                    saveErrLog(joinPoint, request, fail, new CoolException("璁稿彲璇佸け鏁�"), annotation.memo());
+                }
+                return fail;
+            }
             result = joinPoint.proceed(joinPoint.getArgs());
             if (annotation != null && !Cools.isEmpty(annotation.memo())) {
                 saveLog(joinPoint, request, result, annotation.memo());
@@ -63,7 +73,10 @@
             if (annotation != null && !Cools.isEmpty(annotation.memo())) {
                 saveErrLog(joinPoint, request, errorResponse, ex, annotation.memo());
             }
-            throw ex;
+            if (ex instanceof Exception) {
+                throw (Exception) ex;
+            }
+            throw new RuntimeException(ex);
         } finally {
             long end = System.currentTimeMillis();
 //            log.info("璇锋眰鏃ュ織鐨勬墦鍗�");
@@ -122,7 +135,7 @@
 
     private Object buildErrorResponse(Throwable ex) {
         if (ex instanceof CoolException) {
-            return R.parse(ex.getMessage());
+            return R.error(ex.getMessage());
         }
         return R.error();
     }

--
Gitblit v1.9.1