|
@@ -9,10 +9,11 @@ import io.minio.*;
|
|
import java.io.ByteArrayInputStream;
|
|
import java.io.ByteArrayInputStream;
|
|
|
|
|
|
import static cn.iocoder.yudao.framework.file.core.client.s3.S3FileClientConfig.ENDPOINT_ALIYUN;
|
|
import static cn.iocoder.yudao.framework.file.core.client.s3.S3FileClientConfig.ENDPOINT_ALIYUN;
|
|
|
|
+import static cn.iocoder.yudao.framework.file.core.client.s3.S3FileClientConfig.ENDPOINT_TENCENT;
|
|
|
|
|
|
/**
|
|
/**
|
|
* 基于 S3 协议的文件客户端,实现 MinIO、阿里云、腾讯云、七牛云、华为云等云服务
|
|
* 基于 S3 协议的文件客户端,实现 MinIO、阿里云、腾讯云、七牛云、华为云等云服务
|
|
- *
|
|
|
|
|
|
+ * <p>
|
|
* S3 协议的客户端,采用亚马逊提供的 software.amazon.awssdk.s3 库
|
|
* S3 协议的客户端,采用亚马逊提供的 software.amazon.awssdk.s3 库
|
|
*
|
|
*
|
|
* @author 芋道源码
|
|
* @author 芋道源码
|
|
@@ -78,6 +79,11 @@ public class S3FileClient extends AbstractFileClient<S3FileClientConfig> {
|
|
.replaceAll("-internal", "")// 去除内网 Endpoint 的后缀
|
|
.replaceAll("-internal", "")// 去除内网 Endpoint 的后缀
|
|
.replaceAll("https://", "");
|
|
.replaceAll("https://", "");
|
|
}
|
|
}
|
|
|
|
+ // 腾讯云必须有 region,否则会报错
|
|
|
|
+ if (config.getEndpoint().contains(ENDPOINT_TENCENT)) {
|
|
|
|
+ return StrUtil.subAfter(config.getEndpoint(), ".cos.", false)
|
|
|
|
+ .replaceAll("." + ENDPOINT_TENCENT, ""); // 去除 Endpoint
|
|
|
|
+ }
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
|