From 9590de2c1971b596c047deddd926c2b80ade2c67 Mon Sep 17 00:00:00 2001
From: kdyzm <zhengrongjun@haier.com>
Date: 星期三, 02 六月 2021 17:08:00 +0800
Subject: [PATCH] 优化树生成的代码生成:增加loading、修改删除按钮的回调函数为箭头函数

---
 ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java
index 672c023..cb4a225 100644
--- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java
+++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUploadUtils.java
@@ -133,15 +133,13 @@
     {
         File desc = new File(uploadDir + File.separator + fileName);
 
-        if (!desc.getParentFile().exists())
+        if (!desc.exists())
         {
-            desc.getParentFile().mkdirs();
+            if (!desc.getParentFile().exists())
+            {
+                desc.getParentFile().mkdirs();
+            }
         }
-        // 瑙e喅undertow鏂囦欢涓婁紶bug,鍥犲簳灞傚疄鐜颁笉鍚�,鏃犻渶鍒涘缓鏂版枃浠�
-//        if (!desc.exists())
-//        {
-//            desc.createNewFile();
-//        }
         return desc;
     }
 
@@ -189,6 +187,11 @@
                 throw new InvalidExtensionException.InvalidMediaExtensionException(allowedExtension, extension,
                         fileName);
             }
+            else if (allowedExtension == MimeTypeUtils.VIDEO_EXTENSION)
+            {
+                throw new InvalidExtensionException.InvalidVideoExtensionException(allowedExtension, extension,
+                        fileName);
+            }
             else
             {
                 throw new InvalidExtensionException(allowedExtension, extension, fileName);

--
Gitblit v1.9.3