From a4835b1ab25532916f0f8de44efe2aa5cd5cad08 Mon Sep 17 00:00:00 2001 From: tangwenkang <2720983602@qq.com> Date: Mon, 6 Nov 2023 20:01:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E4=B8=8A=E4=BC=A0=E6=97=B6?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../health/video/server/service/impl/VideoServiceImpl.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/health-video-server/src/main/java/com/health/video/server/service/impl/VideoServiceImpl.java b/health-video-server/src/main/java/com/health/video/server/service/impl/VideoServiceImpl.java index 73b7da0..cced880 100644 --- a/health-video-server/src/main/java/com/health/video/server/service/impl/VideoServiceImpl.java +++ b/health-video-server/src/main/java/com/health/video/server/service/impl/VideoServiceImpl.java @@ -214,11 +214,9 @@ public class VideoServiceImpl implements VideoService { String result = originalFilename.substring(0, dotIndex); // 获取文件后缀,因此此后端代码可接收一切文件,上传格式前端限定 String fileExt = file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".") + 1).toLowerCase(); - // 重构文件名称 - String newVideoName = UUID.randomUUID().toString().replaceAll("-", "") + "." + fileExt;// 新的文件名 - vodConfig.put("filename", originalFilename + fileExt); // 此参数不重要,只要能保留文件后缀名如 a.mp4 即可 - vodConfig.put("vn", newVideoName); // .. . 分组配置、回调参数 + vodConfig.put("filename", result + fileExt); // 此参数不重要,只要能保留文件后缀名如 a.mp4 即可 + vodConfig.put("vn", result); // .. . 分组配置、回调参数 JSONObject body = new JSONObject();// 构建body对象 body.put("channel", "VOD_UPLOAD"); body.put("vodConfig", vodConfig);