From 19ef4ca4f7252c34fe2e2a03b8868fc997ddd86f Mon Sep 17 00:00:00 2001
From: dengzedong <dengzedong@email>
Date: 星期五, 13 九月 2024 08:37:38 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 iailab-module-infra/iailab-module-infra-biz/src/main/java/com/iailab/module/infra/framework/file/core/client/s3/S3FileClient.java |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/iailab-module-infra/iailab-module-infra-biz/src/main/java/com/iailab/module/infra/framework/file/core/client/s3/S3FileClient.java b/iailab-module-infra/iailab-module-infra-biz/src/main/java/com/iailab/module/infra/framework/file/core/client/s3/S3FileClient.java
index 3e8cda0..d0fed92 100644
--- a/iailab-module-infra/iailab-module-infra-biz/src/main/java/com/iailab/module/infra/framework/file/core/client/s3/S3FileClient.java
+++ b/iailab-module-infra/iailab-module-infra-biz/src/main/java/com/iailab/module/infra/framework/file/core/client/s3/S3FileClient.java
@@ -37,6 +37,7 @@
                 .region(buildRegion()) // Region
                 .credentials(config.getAccessKey(), config.getAccessSecret()) // 认证密钥
                 .build();
+        enableVirtualStyleEndpoint();
     }
 
     /**
@@ -86,6 +87,18 @@
         return null;
     }
 
+    /**
+     * 开启 VirtualStyle 模式
+     */
+    private void enableVirtualStyleEndpoint() {
+        if (StrUtil.containsAll(config.getEndpoint(),
+                S3FileClientConfig.ENDPOINT_TENCENT, // 腾讯云 https://cloud.tencent.com/document/product/436/41284
+                S3FileClientConfig.ENDPOINT_VOLCES)) { // 火山云 https://www.volcengine.com/docs/6349/1288493
+            client.enableVirtualStyleEndpoint();
+        }
+    }
+
+
     @Override
     public String upload(byte[] content, String path, String type) throws Exception {
         // 执行上传

--
Gitblit v1.9.3