优化没有扩展名则放行全部
This commit is contained in:
@@ -20,6 +20,7 @@ import xtools.boot.log.LogBus;
|
||||
import xtools.boot.log.enums.LogBusBaseType;
|
||||
import xtools.boot.storage.base.config.StorageConfig;
|
||||
import xtools.boot.storage.base.service.StorageService;
|
||||
import xtools.core.ArrUtils;
|
||||
import xtools.core.CollectionUtils;
|
||||
import xtools.core.FileUtils;
|
||||
import xtools.core.HexUtils;
|
||||
@@ -125,8 +126,11 @@ public class SysFileOptServiceImpl implements SysFileOptService, BaseParams {
|
||||
}
|
||||
// 文件格式校验
|
||||
String suffix = FileUtils.getSuffix(fileName);
|
||||
if (!CheckUtils.suffix(suffix, bizType.extArr())) {
|
||||
throw new BizError("文件格式错误");
|
||||
String[] extArr = bizType.extArr();
|
||||
if (ArrUtils.isNotEmpty(extArr)) {
|
||||
if (!CheckUtils.suffix(suffix, extArr)) {
|
||||
throw new BizError("文件格式错误");
|
||||
}
|
||||
}
|
||||
// 文件大小限制
|
||||
long sizeLimit = bizType.sizeLimit();
|
||||
|
||||
Reference in New Issue
Block a user