From 853040cd4267738c92c25ca5befd96e87c62ed86 Mon Sep 17 00:00:00 2001
From: RuoYi <yzz_ivy@163.com>
Date: Thu, 12 Jan 2023 11:42:39 +0800
Subject: [PATCH] 修复gateway流控规则生效但不显示问题
---
ruoyi-modules/ruoyi-file/src/main/java/com/ruoyi/file/service/FastDfsSysFileServiceImpl.java | 9 ++++-----
1 files changed, 4 insertions(+), 5 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 202fdab..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
*/
@@ -29,15 +29,14 @@
* FastDfs文件上传接口
*
* @param file 上传的文件
- * @param baseDir 相对应用的基目录
* @return 访问地址
* @throws Exception
*/
@Override
- public String uploadFile(MultipartFile file, String baseDir) throws Exception
+ 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