增加对excel导入文件扩展名的校验

This commit is contained in:
jishenghua
2025-11-14 21:39:59 +08:00
parent c56d7d2e81
commit eae6f266ed
5 changed files with 49 additions and 16 deletions

View File

@@ -571,8 +571,8 @@ public class MaterialService {
if(StringUtil.isNotEmpty(fileName)) {
String fileExt = fileName.substring(fileName.indexOf(".")+1);
if(!"xls".equals(fileExt)) {
throw new BusinessRunTimeException(ExceptionConstants.MATERIAL_EXTENSION_ERROR_CODE,
ExceptionConstants.MATERIAL_EXTENSION_ERROR_MSG);
throw new BusinessRunTimeException(ExceptionConstants.FILE_EXTENSION_ERROR_CODE,
ExceptionConstants.FILE_EXTENSION_ERROR_MSG);
}
}
Workbook workbook = Workbook.getWorkbook(file.getInputStream());
@@ -1518,4 +1518,4 @@ public class MaterialService {
}
return list;
}
}
}