From 6c28f8a0ddf3d821c81fe820d8e4bd141c99af24 Mon Sep 17 00:00:00 2001 From: 疯狂的狮子Li <15040126243@163.com> Date: 星期三, 22 一月 2025 11:12:38 +0800 Subject: [PATCH] update 优化 驳回增加附件上传 --- ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysOssServiceImpl.java | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysOssServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysOssServiceImpl.java index 4961137..c2eb08c 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysOssServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysOssServiceImpl.java @@ -36,6 +36,7 @@ import java.io.File; import java.io.IOException; +import java.time.Duration; import java.util.ArrayList; import java.util.Collection; import java.util.List; @@ -177,8 +178,7 @@ FileUtils.setAttachmentResponseHeader(response, sysOss.getOriginalName()); response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE + "; charset=UTF-8"); OssClient storage = OssFactory.instance(sysOss.getService()); - long contentLength = storage.download(sysOss.getFileName(), response.getOutputStream()); - response.setContentLengthLong(contentLength); + storage.download(sysOss.getFileName(), response.getOutputStream(), response::setContentLengthLong); } /** -- Gitblit v1.9.3