修改文件访问路径

This commit is contained in:
haozq 2025-09-16 11:08:58 +08:00
parent a7f2ec25d2
commit a61e9074eb
1 changed files with 10 additions and 6 deletions

View File

@ -285,12 +285,16 @@ public class MinioUtil {
*/ */
@SneakyThrows(Exception.class) @SneakyThrows(Exception.class)
public String getFileUrl(String bucketName, String objectName, int expiryTimeInSeconds) { public String getFileUrl(String bucketName, String objectName, int expiryTimeInSeconds) {
return minioClient.getPresignedObjectUrl(GetPresignedObjectUrlArgs.builder() try{
.bucket(bucketName) return minioClient.getPresignedObjectUrl(GetPresignedObjectUrlArgs.builder()
.object(objectName) .bucket(bucketName)
.expiry(expiryTimeInSeconds) .object(objectName)
.method(Method.GET) .expiry(expiryTimeInSeconds)
.build()); .method(Method.GET)
.build());
}catch (Exception e){
return "";
}
} }
/** /**