From 59b42fddeabc28e47ff81ae242156960c2e145c0 Mon Sep 17 00:00:00 2001 From: 疯狂的狮子li <15040126243@163.com> Date: 星期五, 10 七月 2020 11:40:38 +0800 Subject: [PATCH] Merge branch 'master' of https://gitee.com/y_project/RuoYi-Vue --- ruoyi/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java | 18 +++++++++--------- 1 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ruoyi/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java b/ruoyi/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java index 17dc156..f72cfde 100644 --- a/ruoyi/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java +++ b/ruoyi/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java @@ -2,8 +2,6 @@ import java.io.File; import java.io.IOException; - -import com.ruoyi.common.core.lang.UUID; import org.apache.commons.io.FilenameUtils; import org.springframework.web.multipart.MultipartFile; import com.ruoyi.common.constant.Constants; @@ -17,7 +15,7 @@ /** * 鏂囦欢涓婁紶宸ュ叿绫� - * + * * @author ruoyi */ public class FileUploadUtils @@ -84,6 +82,7 @@ } catch (Exception e) { + e.printStackTrace(); throw new IOException(e.getMessage(), e); } } @@ -125,7 +124,7 @@ */ public static final String extractFilename(MultipartFile file) { - String fileName = UUID.randomUUID().toString(true); + String fileName = file.getOriginalFilename(); String extension = getExtension(file); fileName = DateUtils.datePath() + "/" + encodingFilename(fileName) + "." + extension; return fileName; @@ -139,10 +138,11 @@ { desc.getParentFile().mkdirs(); } - if (!desc.exists()) - { - desc.createNewFile(); - } + // 瑙e喅undertow鏂囦欢涓婁紶bug,鍥犲簳灞傚疄鐜颁笉鍚�,鏃犻渶鍒涘缓鏂版枃浠� +// if (!desc.exists()) +// { +// desc.createNewFile(); +// } return desc; } @@ -229,7 +229,7 @@ /** * 鑾峰彇鏂囦欢鍚嶇殑鍚庣紑 - * + * * @param file 琛ㄥ崟鏂囦欢 * @return 鍚庣紑鍚� */ -- Gitblit v1.9.3