mirror of
https://github.com/yangzongzhuan/RuoYi-Cloud.git
synced 2025-09-02 19:04:42 +00:00
完善ruoyi-file模块的upload接口在文件过大和文件名过长的情况下的返回值中的msg提示信息
This commit is contained in:
@@ -4,6 +4,8 @@ import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.Objects;
|
||||
|
||||
import com.ruoyi.common.core.exception.file.FileException;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import com.ruoyi.common.core.exception.file.FileNameLengthLimitExceededException;
|
||||
@@ -46,6 +48,9 @@ public class FileUploadUtils
|
||||
{
|
||||
return upload(baseDir, file, MimeTypeUtils.DEFAULT_ALLOWED_EXTENSION);
|
||||
}
|
||||
catch (FileException fe){
|
||||
throw new IOException(fe.getDefaultMessage(), fe);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
throw new IOException(e.getMessage(), e);
|
||||
|
Reference in New Issue
Block a user