From 4b21a3bc48963ef6e85de832ca05f7b6ee40f6dc Mon Sep 17 00:00:00 2001
From: wangfeiyu <wangfeiyu@cscec.com>
Date: Wed, 22 Feb 2023 08:54:10 +0800
Subject: [PATCH] 在方法isMatchedIp的参数中,当filter为null而ip非null/空时,报filter为null异常。把判断条件由&&改为||解决此bug。
---
ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/service/FastDfsSysFileServiceImpl.java | 6 +++---
1 files changed, 3 insertions(+), 3 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 76ed208..471b40b 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,15 +1,15 @@
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文件存储
+ * FastDFS 文件存储
*
* @author ruoyi
*/
@@ -36,7 +36,7 @@
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();
}
}
--
Gitblit v1.9.3