|
@@ -29,24 +29,24 @@ public class QcloudFileUtils {
|
|
|
static COSClient cosClient = createCli();
|
|
|
|
|
|
static COSClient createCli() {
|
|
|
- return createCli(region);
|
|
|
+ return createCli("ap-shanghai");
|
|
|
}
|
|
|
|
|
|
- private static String accessKey = "AKIDDF4dwzlGVTAmCMGvLVP4UfbHiuqVzFEw";
|
|
|
+ private static String accessKey;
|
|
|
|
|
|
@Value("${cloud.accessKey}")
|
|
|
public void setAccessKey(String accessKeyParam) {
|
|
|
accessKey = accessKeyParam;
|
|
|
}
|
|
|
|
|
|
- private static String secretKey = "TgbFcjZ8HDse9ToujIabLo1yf5YqtfBX";
|
|
|
+ private static String secretKey;
|
|
|
|
|
|
@Value("${cloud.secretKey}")
|
|
|
public void setSecretKey(String secretKeyParam) {
|
|
|
secretKey = secretKeyParam;
|
|
|
}
|
|
|
|
|
|
- private static String region = "ap-shanghai";
|
|
|
+ private static String region;
|
|
|
|
|
|
@Value("${cloud.region}")
|
|
|
public void setRegion(String regionParam) {
|
|
@@ -55,7 +55,7 @@ public class QcloudFileUtils {
|
|
|
|
|
|
static COSClient createCli(String region) {
|
|
|
// 初始化用户身份信息(secretId, secretKey)
|
|
|
- COSCredentials cred = new BasicCOSCredentials(accessKey, secretKey);
|
|
|
+ COSCredentials cred = new BasicCOSCredentials("AKIDDF4dwzlGVTAmCMGvLVP4UfbHiuqVzFEw", "TgbFcjZ8HDse9ToujIabLo1yf5YqtfBX");
|
|
|
// 设置bucket的区域, COS地域的简称请参照 https://www.qcloud.com/document/product/436/6224
|
|
|
ClientConfig clientConfig = new ClientConfig(new Region(region));
|
|
|
// 生成cos客户端
|