#
Junjie
2026-01-12 cfaf44d8ce77be7b6990f16871432ce49fab1fd2
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();
    }