ai预警上传文件路径重复/修复

This commit is contained in:
guoshengxiong 2025-10-29 10:26:17 +08:00
parent b23d4de36c
commit c5ca758835

View File

@ -330,7 +330,8 @@ public class UploadFileServiceImpl implements UploadFileService {
@Override
public String uploadUrlReturnFileName(String url, String relativePath) {
FileInfo fileInfo = fileStorageService.of(UrlUtil.uploadImgUrlToMultipartFile(url)).setPath(relativePath).upload();
return relativePath + "/" + fileInfo.getFilename();
String cleanPath = relativePath.replaceAll("/+$", "");
return cleanPath + "/" + fileInfo.getFilename();
}
/**