fix(infra):修复文件上传路径生成逻辑

- 修改文件名生成方式,使用UUID确保唯一性
-保留原文件扩展名,避免文件类型丢失
- 确保文件路径包含完整文件名和扩展名
This commit is contained in:
2025-10-21 18:59:10 +08:00
parent f38f4fd49a
commit 8c531dd46a

View File

@@ -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())));
}