lead
7 天以前 bc00242ee0410684eb9f4c5fe0aa486dfebb3162
yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/controller/admin/file/FileController.java
@@ -11,6 +11,7 @@
import cn.iocoder.yudao.module.infra.controller.admin.file.vo.file.*;
import cn.iocoder.yudao.module.infra.dal.dataobject.file.FileDO;
import cn.iocoder.yudao.module.infra.service.file.FileService;
import com.google.common.cache.CacheLoader;
import com.google.common.util.concurrent.UncheckedExecutionException;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
@@ -126,6 +127,11 @@
            log.warn("[getFileContent][configId({}) path({}) 文件配置不存在]", configId, path);
            response.setStatus(HttpStatus.NOT_FOUND.value());
            return;
        } catch (CacheLoader.InvalidCacheLoadException ex) {
            // LoadingCache 的 load 返回 null 时抛出(例如历史文件记录的 configId 已被删除),同样按资源不存在处理
            log.warn("[getFileContent][configId({}) path({}) 文件配置不存在]", configId, path);
            response.setStatus(HttpStatus.NOT_FOUND.value());
            return;
        }
        if (content == null) {
            log.warn("[getFileContent][configId({}) path({}) 文件不存在]", configId, path);