!207 update 优化 OSS 自定义域名拼接 无需配置HTTP等前缀

Merge pull request !207 from JaneYork/4.X
This commit is contained in:
疯狂的狮子Li 2022-07-18 03:50:54 +00:00 committed by Gitee
commit 369e4be31c
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -119,12 +119,12 @@ public class OssClient {
}
public String getUrl() {
String header = OssConstant.IS_HTTPS.equals(properties.getIsHttps()) ? "https://" : "http://";
String domain = properties.getDomain();
if (StringUtils.isNotBlank(domain)) {
return domain;
return header + domain;
}
String endpoint = properties.getEndpoint();
String header = OssConstant.IS_HTTPS.equals(properties.getIsHttps()) ? "https://" : "http://";
// 云服务商直接返回
if (StringUtils.containsAny(endpoint, OssConstant.CLOUD_SERVICE)){
return header + properties.getBucketName() + "." + endpoint;