|
@@ -118,18 +118,18 @@ public class SDKTencentCOSServiceImpl implements SDKTencentCOSService {
|
|
|
// @Override
|
|
|
// public TempCredentialsDTO getTempCredentials(String allowPrefix) {
|
|
|
//
|
|
|
-// TreeMap<String, Object> config = new TreeMap<String, Object>();
|
|
|
+// TreeMap<String, Object> KLingAiConfig = new TreeMap<String, Object>();
|
|
|
// try {
|
|
|
//
|
|
|
// // 密钥,使用子账号密钥,授权遵循最小权限指引
|
|
|
-// config.put("secretId", secretId);
|
|
|
-// config.put("secretKey", secretKey);
|
|
|
+// KLingAiConfig.put("secretId", secretId);
|
|
|
+// KLingAiConfig.put("secretKey", secretKey);
|
|
|
//
|
|
|
// // 临时密钥有效时长,单位是秒,默认 120 秒,目前主账号最长 2 小时(即 7200 秒),子账号最长 36 小时(即 129600)秒
|
|
|
// Integer durationSeconds = 120;
|
|
|
-// config.put("durationSeconds", durationSeconds);
|
|
|
-// config.put("bucket", bucketName);
|
|
|
-// config.put("region", region);
|
|
|
+// KLingAiConfig.put("durationSeconds", durationSeconds);
|
|
|
+// KLingAiConfig.put("bucket", bucketName);
|
|
|
+// KLingAiConfig.put("region", region);
|
|
|
//
|
|
|
// // 获取当前时间戳(毫秒)
|
|
|
// long nowDateTime = System.currentTimeMillis() / 1000L;
|
|
@@ -138,7 +138,7 @@ public class SDKTencentCOSServiceImpl implements SDKTencentCOSService {
|
|
|
//
|
|
|
// // 这里改成允许的路径前缀,可以根据自己网站的用户登录态判断允许上传的具体路径,例子:a.jpg 或者 a/* 或者 * 。
|
|
|
// // 如果填写了“*”,将允许用户访问所有资源;除非业务需要,否则请按照最小权限原则授予用户相应的访问权限范围。
|
|
|
-// config.put("allowPrefix", allowPrefix);
|
|
|
+// KLingAiConfig.put("allowPrefix", allowPrefix);
|
|
|
//
|
|
|
// // 密钥的权限列表。简单上传、表单上传和分片上传需要以下的权限,其他权限列表请看 https://cloud.tencent.com/document/product/436/31923
|
|
|
// String[] allowActions = new String[] {
|
|
@@ -161,7 +161,7 @@ public class SDKTencentCOSServiceImpl implements SDKTencentCOSService {
|
|
|
// };
|
|
|
// // "name/cos:*"
|
|
|
//
|
|
|
-// config.put("allowActions", allowActions);
|
|
|
+// KLingAiConfig.put("allowActions", allowActions);
|
|
|
//
|
|
|
// // -- 在后台 存储桶->设置策略 -------------------------------------------------------------
|
|
|
//
|
|
@@ -171,7 +171,7 @@ public class SDKTencentCOSServiceImpl implements SDKTencentCOSService {
|
|
|
//
|
|
|
//
|
|
|
//
|
|
|
-// Response response = CosStsClient.getCredential(config);
|
|
|
+// Response response = CosStsClient.getCredential(KLingAiConfig);
|
|
|
//
|
|
|
// TempCredentialsDTO dto = new TempCredentialsDTO();
|
|
|
// dto.setRegion(region);
|