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