1. lombok 失效:
檢查下配置有沒有使用注解處理器;且這個處理中有沒有帶上版本;版本號需要與上面引入的依賴版本一致。
2.? 對于找不到 log 變量的操作,則是使用下面將這個變量使用下面的代碼定義出來;上面去掉 slf4j注解
@Hidden
@RestControllerAdvice
public class GlobalExceptionHandler {private static final org.slf4j.Logger log = org.slf4j.LoggerFactory.getLogger(GlobalExceptionHandler.class);@ExceptionHandler(BusinessException.class)public BaseResponse<?> businessExceptionHandler(BusinessException e) {log.error("BusinessException", e);return ResultUtils.error(e.getCode(), e.getMessage());}@ExceptionHandler(RuntimeException.class)public BaseResponse<?> runtimeExceptionHandler(RuntimeException e) {log.error("RuntimeException", e);return ResultUtils.error(ErrorCode.SYSTEM_ERROR, "系統錯誤");}
}