mirror of https://gitee.com/stylefeng/roses
commit
e63108cc96
|
@ -52,4 +52,9 @@ public class AliyunOssProperties {
|
||||||
*/
|
*/
|
||||||
private String accessKeySecret;
|
private String accessKeySecret;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取资源前缀是否为https
|
||||||
|
*/
|
||||||
|
private Boolean isHttps = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,10 +32,8 @@ import cn.stylefeng.roses.kernel.file.api.exception.FileException;
|
||||||
import cn.stylefeng.roses.kernel.file.api.exception.enums.FileExceptionEnum;
|
import cn.stylefeng.roses.kernel.file.api.exception.enums.FileExceptionEnum;
|
||||||
import cn.stylefeng.roses.kernel.file.api.expander.FileConfigExpander;
|
import cn.stylefeng.roses.kernel.file.api.expander.FileConfigExpander;
|
||||||
import cn.stylefeng.roses.kernel.file.api.pojo.props.AliyunOssProperties;
|
import cn.stylefeng.roses.kernel.file.api.pojo.props.AliyunOssProperties;
|
||||||
import com.aliyun.oss.ClientException;
|
import com.aliyun.oss.*;
|
||||||
import com.aliyun.oss.OSS;
|
import com.aliyun.oss.common.comm.Protocol;
|
||||||
import com.aliyun.oss.OSSClientBuilder;
|
|
||||||
import com.aliyun.oss.OSSException;
|
|
||||||
import com.aliyun.oss.model.CannedAccessControlList;
|
import com.aliyun.oss.model.CannedAccessControlList;
|
||||||
import com.aliyun.oss.model.OSSObject;
|
import com.aliyun.oss.model.OSSObject;
|
||||||
import com.aliyun.oss.model.PutObjectRequest;
|
import com.aliyun.oss.model.PutObjectRequest;
|
||||||
|
@ -73,9 +71,11 @@ public class AliyunFileOperator implements FileOperatorApi {
|
||||||
String endpoint = aliyunOssProperties.getEndPoint();
|
String endpoint = aliyunOssProperties.getEndPoint();
|
||||||
String accessKeyId = aliyunOssProperties.getAccessKeyId();
|
String accessKeyId = aliyunOssProperties.getAccessKeyId();
|
||||||
String accessKeySecret = aliyunOssProperties.getAccessKeySecret();
|
String accessKeySecret = aliyunOssProperties.getAccessKeySecret();
|
||||||
|
Boolean isHttps = aliyunOssProperties.getIsHttps();
|
||||||
|
ClientBuilderConfiguration clientBuilderConfiguration = new ClientBuilderConfiguration();
|
||||||
|
clientBuilderConfiguration.setProtocol(isHttps ? Protocol.HTTPS : Protocol.HTTP);
|
||||||
// 创建OSSClient实例。
|
// 创建OSSClient实例。
|
||||||
ossClient = new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret);
|
ossClient = new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret, clientBuilderConfiguration);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -10,6 +10,7 @@ import cn.stylefeng.roses.kernel.db.api.factory.PageResultFactory;
|
||||||
import cn.stylefeng.roses.kernel.db.api.pojo.entity.BaseEntity;
|
import cn.stylefeng.roses.kernel.db.api.pojo.entity.BaseEntity;
|
||||||
import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult;
|
import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult;
|
||||||
import cn.stylefeng.roses.kernel.file.api.FileInfoApi;
|
import cn.stylefeng.roses.kernel.file.api.FileInfoApi;
|
||||||
|
import cn.stylefeng.roses.kernel.file.api.expander.FileConfigExpander;
|
||||||
import cn.stylefeng.roses.kernel.file.api.pojo.AntdvFileInfo;
|
import cn.stylefeng.roses.kernel.file.api.pojo.AntdvFileInfo;
|
||||||
import cn.stylefeng.roses.kernel.file.api.pojo.request.SysFileInfoRequest;
|
import cn.stylefeng.roses.kernel.file.api.pojo.request.SysFileInfoRequest;
|
||||||
import cn.stylefeng.roses.kernel.rule.callback.ConfigUpdateCallback;
|
import cn.stylefeng.roses.kernel.rule.callback.ConfigUpdateCallback;
|
||||||
|
@ -247,7 +248,7 @@ public class SysThemeServiceImpl extends ServiceImpl<SysThemeMapper, SysTheme> i
|
||||||
this.parseFileUrls(result);
|
this.parseFileUrls(result);
|
||||||
|
|
||||||
// 缓存系统中激活的主题
|
// 缓存系统中激活的主题
|
||||||
themeCacheApi.put(ThemeConstants.THEME_GUNS_PLATFORM, result);
|
themeCacheApi.put(ThemeConstants.THEME_GUNS_PLATFORM, result, FileConfigExpander.getDefaultFileTimeoutSeconds());
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue