Commit 210d2db3 by 段启岩

文件上传限制

parent b68e8a1e
......@@ -5,6 +5,7 @@ import java.util.Set;
/**
* 系统常量
*
* @author meteor
*/
public class SysConstants {
......@@ -31,9 +32,9 @@ public class SysConstants {
public static final long DEFAULT_MAX_SIZE = 1024 * 1024 * 3;
public static final Set<String> SUFFIXES_OF_IMAGE = Set.of(".jpg");
public static final Set<String> SUFFIXES_OF_IMAGE = Set.of("bmp", "jpg", "png", "tif", "gif", "pcx", "tga", "exif", "fpx", "svg", "psd", "cdr", "pcd", "dxf", "ufo", "eps");
public static final Set<String> SUFFIXES_OF_VIDEO = Set.of(".mp4");
public static final Set<String> SUFFIXES_OF_VIDEO = Set.of(".mp4", ".oog", ".webm");
/**
*
......
......@@ -44,7 +44,7 @@ public class FileUploadServiceImpl implements IFileUploadService {
// 后缀错误
if (uploadType.getAcceptSuffixes().contains(suffix)) {
if (!uploadType.getAcceptSuffixes().contains(suffix)) {
throw new FileUploadServiceException(FileUploadErrorCode.ERROR_SUFFIX);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment