diff --git a/kernel-d-file/file-api/src/main/java/cn/stylefeng/roses/kernel/file/api/pojo/props/AliyunOssProperties.java b/kernel-d-file/file-api/src/main/java/cn/stylefeng/roses/kernel/file/api/pojo/props/AliyunOssProperties.java index e9fa2f042..f42663256 100644 --- a/kernel-d-file/file-api/src/main/java/cn/stylefeng/roses/kernel/file/api/pojo/props/AliyunOssProperties.java +++ b/kernel-d-file/file-api/src/main/java/cn/stylefeng/roses/kernel/file/api/pojo/props/AliyunOssProperties.java @@ -55,6 +55,6 @@ public class AliyunOssProperties { /** * 获取资源前缀是否为https */ - private Boolean isHttps = false; + private Boolean httpsFlag = false; } diff --git a/kernel-d-file/file-sdk-aliyun/src/main/java/cn/stylefeng/roses/kernel/file/aliyun/AliyunFileOperator.java b/kernel-d-file/file-sdk-aliyun/src/main/java/cn/stylefeng/roses/kernel/file/aliyun/AliyunFileOperator.java index a5b98d9e9..47baa0367 100644 --- a/kernel-d-file/file-sdk-aliyun/src/main/java/cn/stylefeng/roses/kernel/file/aliyun/AliyunFileOperator.java +++ b/kernel-d-file/file-sdk-aliyun/src/main/java/cn/stylefeng/roses/kernel/file/aliyun/AliyunFileOperator.java @@ -71,9 +71,12 @@ public class AliyunFileOperator implements FileOperatorApi { String endpoint = aliyunOssProperties.getEndPoint(); String accessKeyId = aliyunOssProperties.getAccessKeyId(); String accessKeySecret = aliyunOssProperties.getAccessKeySecret(); - Boolean isHttps = aliyunOssProperties.getIsHttps(); + + // 根据https开关,配置协议类型 + Boolean httpsFlag = aliyunOssProperties.getHttpsFlag(); ClientBuilderConfiguration clientBuilderConfiguration = new ClientBuilderConfiguration(); - clientBuilderConfiguration.setProtocol(isHttps ? Protocol.HTTPS : Protocol.HTTP); + clientBuilderConfiguration.setProtocol(httpsFlag ? Protocol.HTTPS : Protocol.HTTP); + // 创建OSSClient实例。 ossClient = new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret, clientBuilderConfiguration); }