|
@@ -139,6 +139,11 @@ public class OSSUtils {
|
|
|
OSS ossClient = new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret);
|
|
|
// 设置URL过期时间为1个小时
|
|
|
Date expiration = new Date(new Date().getTime() + 3600L * 1000);
|
|
|
+ if ("product".equals(config)) {
|
|
|
+ fileName = "prod/" + fileName;
|
|
|
+ } else {
|
|
|
+ fileName = config + "/" + fileName;
|
|
|
+ }
|
|
|
String url = ossClient.generatePresignedUrl(privateBucket, fileName, expiration).toString();
|
|
|
// 关闭OSSClient。
|
|
|
ossClient.shutdown();
|