From 517277132e89b36da2fe73c850cea0680eb918b7 Mon Sep 17 00:00:00 2001 From: AprilWind <2100166581@qq.com> Date: 星期三, 16 十月 2024 10:36:43 +0800 Subject: [PATCH] fix 修复腾讯云oss不支持高危权限设置ACL --- ruoyi-common/ruoyi-common-oss/src/main/java/org/dromara/common/oss/core/OssClient.java | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ruoyi-common/ruoyi-common-oss/src/main/java/org/dromara/common/oss/core/OssClient.java b/ruoyi-common/ruoyi-common-oss/src/main/java/org/dromara/common/oss/core/OssClient.java index 86668aa..62493f3 100644 --- a/ruoyi-common/ruoyi-common-oss/src/main/java/org/dromara/common/oss/core/OssClient.java +++ b/ruoyi-common/ruoyi-common-oss/src/main/java/org/dromara/common/oss/core/OssClient.java @@ -83,8 +83,8 @@ StaticCredentialsProvider credentialsProvider = StaticCredentialsProvider.create( AwsBasicCredentials.create(properties.getAccessKey(), properties.getSecretKey())); - //MinIO 浣跨敤 HTTPS 闄愬埗浣跨敤鍩熷悕璁块棶锛岀珯鐐瑰~鍩熷悕銆傞渶瑕佸惎鐢ㄨ矾寰勬牱寮忚闂� - boolean isStyle = !StringUtils.containsAny(properties.getEndpoint(), OssConstant.CLOUD_SERVICE); + //浣跨敤瀵硅薄瀛樺偍鏈嶅姟鏃惰姹傛槑纭厤缃闂牱寮忥紙璺緞鏍峰紡鎴栬櫄鎷熸墭绠℃牱寮忥級銆傞渶瑕佸惎鐢ㄨ矾寰勬牱寮忚闂� + boolean isStyle = true; //鍒涘缓AWS鍩轰簬 CRT 鐨� S3 瀹㈡埛绔� this.client = S3AsyncClient.crtBuilder() @@ -338,8 +338,8 @@ * @return UploadResult 鍖呭惈涓婁紶鍚庣殑鏂囦欢淇℃伅 * @throws OssException 濡傛灉涓婁紶澶辫触锛屾姏鍑鸿嚜瀹氫箟寮傚父 */ - public UploadResult uploadSuffix(byte[] data, String suffix) { - return upload(new ByteArrayInputStream(data), getPath(properties.getPrefix(), suffix), Long.valueOf(data.length), FileUtils.getMimeType(suffix)); + public UploadResult uploadSuffix(byte[] data, String suffix, String contentType) { + return upload(new ByteArrayInputStream(data), getPath(properties.getPrefix(), suffix), Long.valueOf(data.length), contentType); } /** @@ -351,8 +351,8 @@ * @return UploadResult 鍖呭惈涓婁紶鍚庣殑鏂囦欢淇℃伅 * @throws OssException 濡傛灉涓婁紶澶辫触锛屾姏鍑鸿嚜瀹氫箟寮傚父 */ - public UploadResult uploadSuffix(InputStream inputStream, String suffix, Long length) { - return upload(inputStream, getPath(properties.getPrefix(), suffix), length, FileUtils.getMimeType(suffix)); + public UploadResult uploadSuffix(InputStream inputStream, String suffix, Long length, String contentType) { + return upload(inputStream, getPath(properties.getPrefix(), suffix), length, contentType); } /** -- Gitblit v1.9.3