From c42229bc5435ecc7db0561029d09f55a4680282d Mon Sep 17 00:00:00 2001 From: baymax <862592396@qq.com> Date: 星期日, 25 十二月 2022 22:15:31 +0800 Subject: [PATCH] 优化: 移除 UserOnlineDTO 导入但未使用的类 --- 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