mirror of
https://github.com/YunaiV/ruoyi-vue-pro.git
synced 2025-10-29 17:48:29 +08:00
🐛 修复 ExcelUtils 报错
This commit is contained in:
@ -38,7 +38,7 @@ public class ExcelUtils {
|
|||||||
.registerConverter(new LongStringConverter()) // 避免 Long 类型丢失精度
|
.registerConverter(new LongStringConverter()) // 避免 Long 类型丢失精度
|
||||||
.sheet(sheetName).doWrite(data);
|
.sheet(sheetName).doWrite(data);
|
||||||
// 设置 header 和 contentType。写在最后的原因是,避免报错时,响应 contentType 已经被修改了
|
// 设置 header 和 contentType。写在最后的原因是,避免报错时,响应 contentType 已经被修改了
|
||||||
response.addHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(filename, StandardCharsets.UTF_8));
|
response.addHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(filename, StandardCharsets.UTF_8.name()));
|
||||||
response.setContentType("application/vnd.ms-excel;charset=UTF-8");
|
response.setContentType("application/vnd.ms-excel;charset=UTF-8");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user