From 8c531dd46aed98ccf878a5779fa81df77c76d1ce Mon Sep 17 00:00:00 2001 From: yang chen Date: Tue, 21 Oct 2025 18:59:10 +0800 Subject: [PATCH] =?UTF-8?q?fix(infra):=E4=BF=AE=E5=A4=8D=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E8=B7=AF=E5=BE=84=E7=94=9F=E6=88=90=E9=80=BB?= =?UTF-8?q?=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改文件名生成方式,使用UUID确保唯一性 -保留原文件扩展名,避免文件类型丢失 - 确保文件路径包含完整文件名和扩展名 --- .../com/jeelowcode/service/infra/controller/FileController.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jeelowcode-service/jeelowcode-service-infra-biz/src/main/java/com/jeelowcode/service/infra/controller/FileController.java b/jeelowcode-service/jeelowcode-service-infra-biz/src/main/java/com/jeelowcode/service/infra/controller/FileController.java index 42382f4..1608efa 100644 --- a/jeelowcode-service/jeelowcode-service-infra-biz/src/main/java/com/jeelowcode/service/infra/controller/FileController.java +++ b/jeelowcode-service/jeelowcode-service-infra-biz/src/main/java/com/jeelowcode/service/infra/controller/FileController.java @@ -67,7 +67,7 @@ public class FileController { String path = publicPath + fileName; fileName = fileService.getUniqueFileName(fileName, path); - path = publicPath + fileName; + path = publicPath + IdUtil.simpleUUID() + (StrUtil.isEmpty(FileUtil.extName(fileName)) ? "" : ("." + FileUtil.extName(fileName))); return success(fileService.createFile(fileName, path, IoUtil.readBytes(file.getInputStream()))); }