fix 修复 minio 上传自定义域名回显路径错误问题
parent
b877ec0e62
commit
dda667d06e
|
|
@ -121,16 +121,19 @@ public class OssClient {
|
||||||
|
|
||||||
public String getUrl() {
|
public String getUrl() {
|
||||||
String domain = properties.getDomain();
|
String domain = properties.getDomain();
|
||||||
if (StringUtils.isNotBlank(domain)) {
|
|
||||||
return domain;
|
|
||||||
}
|
|
||||||
String endpoint = properties.getEndpoint();
|
String endpoint = properties.getEndpoint();
|
||||||
String header = OssConstant.IS_HTTPS.equals(properties.getIsHttps()) ? "https://" : "http://";
|
String header = OssConstant.IS_HTTPS.equals(properties.getIsHttps()) ? "https://" : "http://";
|
||||||
// 云服务商直接返回
|
// 云服务商直接返回
|
||||||
if (StringUtils.containsAny(endpoint, OssConstant.CLOUD_SERVICE)){
|
if (StringUtils.containsAny(endpoint, OssConstant.CLOUD_SERVICE)){
|
||||||
|
if (StringUtils.isNotBlank(domain)) {
|
||||||
|
return domain;
|
||||||
|
}
|
||||||
return header + properties.getBucketName() + "." + endpoint;
|
return header + properties.getBucketName() + "." + endpoint;
|
||||||
}
|
}
|
||||||
// minio 单独处理
|
// minio 单独处理
|
||||||
|
if (StringUtils.isNotBlank(domain)) {
|
||||||
|
return domain + "/" + properties.getBucketName();
|
||||||
|
}
|
||||||
return header + endpoint + "/" + properties.getBucketName();
|
return header + endpoint + "/" + properties.getBucketName();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue