From 664d9030efca22edd8e43b4db4b2c0700fff44af Mon Sep 17 00:00:00 2001
From: Junjie <DELL@qq.com>
Date: 星期三, 14 一月 2026 09:18:33 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/common/config/AspectConfig.java | 14 ++++++++++++--
1 files changed, 12 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..07f14cc 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,7 @@
if (annotation != null && !Cools.isEmpty(annotation.memo())) {
saveErrLog(joinPoint, request, errorResponse, ex, annotation.memo());
}
- throw ex;
+ return errorResponse;
} finally {
long end = System.currentTimeMillis();
// log.info("璇锋眰鏃ュ織鐨勬墦鍗�");
@@ -122,7 +132,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