|
@@ -32,7 +32,7 @@ public class OSSUtil {
|
|
|
private String OSS_TYPE_PIC;
|
|
|
|
|
|
public boolean uploadFile(String ossObjectKey, File file){
|
|
|
- OSS client = new OSSClientBuilder().build(OSS_ENDPOINT_WW, ACCESS_KEY_ID, ACCESS_KEY_SECERT);
|
|
|
+ OSS client = new OSSClientBuilder().build(OSS_ENDPOINT, ACCESS_KEY_ID, ACCESS_KEY_SECERT);
|
|
|
PutObjectResult putObjectResult = client.putObject(new PutObjectRequest(OSS_BUCKET_NAME, ossObjectKey, file));
|
|
|
log.info("putObjectResult" + putObjectResult);
|
|
|
return true;
|
|
@@ -51,7 +51,7 @@ public class OSSUtil {
|
|
|
|
|
|
public String getUrlWw(String key){
|
|
|
// OSS clientWw = new OSSClientBuilder().build("https://"+OSS_ENDPOINT_WW,ACCESS_KEY_ID,ACCESS_KEY_SECERT);
|
|
|
- OSS clientWw = new OSSClientBuilder().build(OSS_ENDPOINT_WW,ACCESS_KEY_ID,ACCESS_KEY_SECERT);
|
|
|
+ OSS clientWw = new OSSClientBuilder().build(OSS_ENDPOINT,ACCESS_KEY_ID,ACCESS_KEY_SECERT);
|
|
|
// 设置URL过期时间为1小时
|
|
|
Date expiration = new Date(new Date().getTime() + 3600 * 1000);
|
|
|
GeneratePresignedUrlRequest generatePresignedUrlRequest ;
|