From a5ad8bb708d708ef5e9d2a2e7bc12deb99ee924e Mon Sep 17 00:00:00 2001 From: puhui999 Date: Wed, 18 Jun 2025 12:45:22 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=B8=8A=E4=BC=A0MP4?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E4=B9=8B=E5=90=8E=E9=80=9A=E8=BF=87=E4=B8=8B?= =?UTF-8?q?=E8=BD=BD=E8=BF=9E=E6=8E=A5=E4=B8=8B=E8=BD=BDMP4=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E6=BA=90=E6=96=87=E4=BB=B6=E8=83=BD=E9=80=9A=E8=BF=87?= =?UTF-8?q?windows=E8=87=AA=E5=B8=A6=E6=92=AD=E6=94=BE=E5=99=A8=E6=92=AD?= =?UTF-8?q?=E6=94=BE=E4=B8=8B=E8=BD=BD=E4=B8=8B=E6=9D=A5=E7=9A=84=E6=92=AD?= =?UTF-8?q?=E6=94=BE=E4=B8=8D=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../infra/framework/file/core/utils/FileTypeUtils.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/utils/FileTypeUtils.java b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/utils/FileTypeUtils.java index e2c607842..9cc417588 100644 --- a/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/utils/FileTypeUtils.java +++ b/yudao-module-infra/src/main/java/cn/iocoder/yudao/module/infra/framework/file/core/utils/FileTypeUtils.java @@ -3,7 +3,6 @@ package cn.iocoder.yudao.module.infra.framework.file.core.utils; import cn.hutool.core.io.IoUtil; import cn.hutool.core.util.StrUtil; import cn.iocoder.yudao.framework.common.util.http.HttpUtils; -import com.alibaba.ttl.TransmittableThreadLocal; import jakarta.servlet.http.HttpServletResponse; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; @@ -86,8 +85,8 @@ public class FileTypeUtils { response.setContentType(contentType); // 针对 video 的特殊处理,解决视频地址在移动端播放的兼容性问题 if (StrUtil.containsIgnoreCase(contentType, "video")) { - response.setHeader("Content-Length", String.valueOf(content.length - 1)); - response.setHeader("Content-Range", String.valueOf(content.length - 1)); + response.setHeader("Content-Length", String.valueOf(content.length)); + response.setHeader("Content-Range", "bytes 0-" + (content.length - 1) + "/" + content.length); response.setHeader("Accept-Ranges", "bytes"); } // 输出附件