From 5e3231d59b46adfb6e44cd4b4fb17ece12c931a9 Mon Sep 17 00:00:00 2001 From: AprilWind <2100166581@qq.com> Date: 星期三, 11 九月 2024 12:02:16 +0800 Subject: [PATCH] !582 优化admin配置文件读取 * update 优化admin监控配置读取名称 * update 优化admin监控配置读取 --- ruoyi-common/ruoyi-common-oss/src/main/java/org/dromara/common/oss/core/OssClient.java | 10 ++++++---- 1 files changed, 6 insertions(+), 4 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..bde26ae 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 @@ -178,6 +178,7 @@ .key(key) .contentMD5(StringUtils.isNotEmpty(md5Digest) ? md5Digest : null) .contentType(contentType) + .acl(getAccessPolicy().getObjectCannedACL()) .build()) .addTransferListener(LoggingTransferListener.create()) .source(filePath).build()); @@ -223,6 +224,7 @@ y -> y.bucket(properties.getBucketName()) .key(key) .contentType(contentType) + .acl(getAccessPolicy().getObjectCannedACL()) .build()) .build()); @@ -338,8 +340,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 +353,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