From a1431c5cb198c42d8830969a9a35710fddbc92c0 Mon Sep 17 00:00:00 2001 From: 疯狂的狮子Li <15040126243@163.com> Date: 星期四, 17 十一月 2022 17:33:32 +0800 Subject: [PATCH] !251 add 新增字典数据映射注解,根据字段数据(sys_dict_data表).dict_type 的 value 映射对应的 label Merge pull request !251 from itino/dev-itino --- ruoyi-oss/src/main/java/com/ruoyi/oss/core/OssClient.java | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/ruoyi-oss/src/main/java/com/ruoyi/oss/core/OssClient.java b/ruoyi-oss/src/main/java/com/ruoyi/oss/core/OssClient.java index d6e058d..fe409ce 100644 --- a/ruoyi-oss/src/main/java/com/ruoyi/oss/core/OssClient.java +++ b/ruoyi-oss/src/main/java/com/ruoyi/oss/core/OssClient.java @@ -1,5 +1,6 @@ package com.ruoyi.oss.core; +import cn.hutool.core.io.IoUtil; import cn.hutool.core.util.IdUtil; import com.amazonaws.ClientConfiguration; import com.amazonaws.HttpMethod; @@ -97,6 +98,9 @@ } public UploadResult upload(InputStream inputStream, String path, String contentType) { + if (!(inputStream instanceof ByteArrayInputStream)) { + inputStream = new ByteArrayInputStream(IoUtil.readBytes(inputStream)); + } try { ObjectMetadata metadata = new ObjectMetadata(); metadata.setContentType(contentType); -- Gitblit v1.9.3