fix:移除OSS文件访问地址过期时间

This commit is contained in:
czhqwer
2025-03-30 19:07:23 +08:00
parent e660199d4d
commit 775160810f

View File

@@ -318,9 +318,12 @@ public class OssStorageService implements IStorageService {
* 获取文件访问 URL * 获取文件访问 URL
*/ */
private String getFileAccessUrl(String objectName) { private String getFileAccessUrl(String objectName) {
// 返回预签名 URL过期时间为 1 小时 String endpoint = storageConfig.getEndpoint().replace("https://", "");
Date expiration = new Date(new Date().getTime() + 3600 * 1000); // 构造永久有效的公开 URL
return ossClient.generatePresignedUrl(storageConfig.getBucket(), objectName, expiration).toString(); return String.format("https://%s.%s/%s",
storageConfig.getBucket(),
endpoint,
objectName);
} }
/** /**