mirror of
https://gitee.com/czh-dev/upload-hub
synced 2026-07-10 23:41:20 +08:00
fix:移除OSS文件访问地址过期时间
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user