From 8fdb3c4d14dfbc31f16697273f77717b2fa1294d Mon Sep 17 00:00:00 2001 From: RuoYi Date: Sat, 30 Jul 2022 22:53:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BD=BF=E7=94=A8FastDFS?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E5=A4=B4=E5=83=8F=E5=A4=B1=E8=B4=A5=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E6=96=87=E4=BB=B6=E5=90=8D=E6=B2=A1=E6=9C=89=E5=90=8E?= =?UTF-8?q?=E7=BC=80=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/ruoyi/file/service/FastDfsSysFileServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/service/FastDfsSysFileServiceImpl.java b/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/service/FastDfsSysFileServiceImpl.java index deee22ee2..471b40b00 100644 --- a/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/service/FastDfsSysFileServiceImpl.java +++ b/ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/service/FastDfsSysFileServiceImpl.java @@ -1,12 +1,12 @@ package com.ruoyi.file.service; -import org.apache.commons.io.FilenameUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.web.multipart.MultipartFile; import com.github.tobato.fastdfs.domain.fdfs.StorePath; import com.github.tobato.fastdfs.service.FastFileStorageClient; +import com.ruoyi.common.core.utils.file.FileTypeUtils; /** * FastDFS 文件存储 @@ -36,7 +36,7 @@ public class FastDfsSysFileServiceImpl implements ISysFileService public String uploadFile(MultipartFile file) throws Exception { StorePath storePath = storageClient.uploadFile(file.getInputStream(), file.getSize(), - FilenameUtils.getExtension(file.getOriginalFilename()), null); + FileTypeUtils.getExtension(file), null); return domain + "/" + storePath.getFullPath(); } }