From 23ca5b2b418630b54b58b24621416a7b40c1d3b1 Mon Sep 17 00:00:00 2001
From: maven <2163098428@qq.com>
Date: 星期四, 10 七月 2025 17:25:14 +0800
Subject: [PATCH] yys 修改导入导出bug
---
src/main/java/com/ruoyi/other/service/impl/TempFileServiceImpl.java | 4 +++-
pom.xml | 8 --------
2 files changed, 3 insertions(+), 9 deletions(-)
diff --git a/pom.xml b/pom.xml
index 938ccdd..51d1a67 100644
--- a/pom.xml
+++ b/pom.xml
@@ -288,14 +288,6 @@
<fork>true</fork> <!-- 濡傛灉娌℃湁璇ラ厤缃紝devtools涓嶄細鐢熸晥 -->
</configuration>
</plugin>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>10</source>
- <target>10</target>
- </configuration>
- </plugin>
</plugins>
</build>
diff --git a/src/main/java/com/ruoyi/other/service/impl/TempFileServiceImpl.java b/src/main/java/com/ruoyi/other/service/impl/TempFileServiceImpl.java
index 147c79a..442b090 100644
--- a/src/main/java/com/ruoyi/other/service/impl/TempFileServiceImpl.java
+++ b/src/main/java/com/ruoyi/other/service/impl/TempFileServiceImpl.java
@@ -6,6 +6,7 @@
import com.ruoyi.other.pojo.TempFile;
import com.ruoyi.other.service.TempFileService;
import lombok.extern.slf4j.Slf4j;
+import org.apache.catalina.util.URLEncoder;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
@@ -38,7 +39,8 @@
String tempId = UUID.randomUUID().toString();
String originalFilename = file.getOriginalFilename();
if(originalFilename == null) throw new IOException("鏂囦欢鍚嶄笉鑳戒负绌�");
- String encodedFilename = java.net.URLEncoder.encode(originalFilename, StandardCharsets.UTF_8);
+ URLEncoder urlEncoder = new URLEncoder();
+ String encodedFilename = urlEncoder.encode(originalFilename, StandardCharsets.UTF_8);
Path tempFilePath = Paths.get(tempDir, tempId + "_" + encodedFilename);
// Path tempFilePath = Paths.get(tempDir, tempId + "_" + file.getOriginalFilename());
--
Gitblit v1.9.3