Compare commits

...

3 Commits

Author SHA1 Message Date
沧澜一粟 d7eef05716
Pre Merge pull request !447 from 沧澜一粟/master 2026-01-06 05:54:34 +00:00
RuoYi e942847b89 修复Excel自定义格式样式污染问题 2026-01-06 13:54:27 +08:00
zxx a394fdb84a axios升级版本到0.30.2 修复漏洞CVE-2025-58754 2025-12-26 18:23:22 +08:00
2 changed files with 17 additions and 2 deletions

View File

@ -1003,7 +1003,7 @@ public class ExcelUtil<T>
String separator = attr.separator();
if (StringUtils.isNotEmpty(dateFormat) && StringUtils.isNotNull(value))
{
cell.getCellStyle().setDataFormat(this.wb.getCreationHelper().createDataFormat().getFormat(dateFormat));
cell.setCellStyle(createCellStyle(cell.getCellStyle(), dateFormat));
cell.setCellValue(parseDateToStr(dateFormat, value));
}
else if (StringUtils.isNotEmpty(readConverterExp) && StringUtils.isNotNull(value))
@ -1033,6 +1033,21 @@ public class ExcelUtil<T>
return cell;
}
/**
* 使
*
* @param cellStyle
* @param format
* @return CellStyle
*/
private CellStyle createCellStyle(CellStyle cellStyle, String format)
{
CellStyle style = wb.createCellStyle();
style.cloneStyleFrom(cellStyle);
style.setDataFormat(wb.getCreationHelper().createDataFormat().getFormat(format));
return style;
}
/**
* POI XSSFSheet
*

View File

@ -25,7 +25,7 @@
},
"dependencies": {
"@riophae/vue-treeselect": "0.4.0",
"axios": "0.28.1",
"axios": "0.30.2",
"clipboard": "2.0.8",
"core-js": "3.37.1",
"echarts": "5.4.0",