From dda667d06ed473a24c87511318f3e9d8d070c444 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90li?= <15040126243@163.com> Date: Tue, 5 Jul 2022 15:21:08 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E4=BF=AE=E5=A4=8D=20minio=20=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E8=87=AA=E5=AE=9A=E4=B9=89=E5=9F=9F=E5=90=8D=E5=9B=9E?= =?UTF-8?q?=E6=98=BE=E8=B7=AF=E5=BE=84=E9=94=99=E8=AF=AF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/ruoyi/common/oss/core/OssClient.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ruoyi-common/ruoyi-common-oss/src/main/java/com/ruoyi/common/oss/core/OssClient.java b/ruoyi-common/ruoyi-common-oss/src/main/java/com/ruoyi/common/oss/core/OssClient.java index 809bc0d4..bfc791f4 100644 --- a/ruoyi-common/ruoyi-common-oss/src/main/java/com/ruoyi/common/oss/core/OssClient.java +++ b/ruoyi-common/ruoyi-common-oss/src/main/java/com/ruoyi/common/oss/core/OssClient.java @@ -121,16 +121,19 @@ public class OssClient { public String getUrl() { String domain = properties.getDomain(); - if (StringUtils.isNotBlank(domain)) { - return domain; - } String endpoint = properties.getEndpoint(); String header = OssConstant.IS_HTTPS.equals(properties.getIsHttps()) ? "https://" : "http://"; // 云服务商直接返回 if (StringUtils.containsAny(endpoint, OssConstant.CLOUD_SERVICE)){ + if (StringUtils.isNotBlank(domain)) { + return domain; + } return header + properties.getBucketName() + "." + endpoint; } // minio 单独处理 + if (StringUtils.isNotBlank(domain)) { + return domain + "/" + properties.getBucketName(); + } return header + endpoint + "/" + properties.getBucketName(); }