Easyexcel出现导出的文件格式不正确

问题描述: 在工作时遇到需要导出excel文件的需求,在csdn上找到了utils,但是导出的文件格式错误。 原utils设置Content-type res

问题描述:
在工作时遇到需要导出excel文件的需求,在csdn上找到了utils,但是导出的文件格式错误。
原utils设置Content-type

response.setContentType("application/vnd.ms-excel");// 设置文本内容

解决方法:

response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");// 设置文本内容

设置此Content-type可以解决