修改文件访问路径

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)
public String getFileUrl(String bucketName, String objectName, int expiryTimeInSeconds) {
return minioClient.getPresignedObjectUrl(GetPresignedObjectUrlArgs.builder()
.bucket(bucketName)
.object(objectName)
.expiry(expiryTimeInSeconds)
.method(Method.GET)
.build());
try{
return minioClient.getPresignedObjectUrl(GetPresignedObjectUrlArgs.builder()
.bucket(bucketName)
.object(objectName)
.expiry(expiryTimeInSeconds)
.method(Method.GET)
.build());
}catch (Exception e){
return "";
}
}
/**