From 2ab7c7feaeea8be05dcfbaa3dca16e492accd166 Mon Sep 17 00:00:00 2001 From: 疯狂的狮子Li <15040126243@163.com> Date: 星期三, 02 六月 2021 18:20:06 +0800 Subject: [PATCH] !47 【优化】代码生成器新增、修改页面的按钮动作loading从页面loading到按钮loading Merge pull request !47 from 狂盗一枝梅/kdyzm --- 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