Pre Merge pull request !52 from dazer007/master

This commit is contained in:
dazer007 2021-03-16 16:27:47 +08:00 committed by Gitee
commit 4349bcf83c
1 changed files with 4 additions and 2 deletions

View File

@ -321,7 +321,8 @@ public class ExcelUtil<T>
*/
public void exportExcel(HttpServletResponse response, List<T> list, String sheetName) throws IOException
{
response.setContentType("application/vnd.ms-excel");
//response.setContentType("application/vnd.ms-excel");
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
response.setCharacterEncoding("utf-8");
this.init(list, sheetName, Type.EXPORT);
exportExcel(response.getOutputStream());
@ -335,7 +336,8 @@ public class ExcelUtil<T>
*/
public void importTemplateExcel(HttpServletResponse response, String sheetName) throws IOException
{
response.setContentType("application/vnd.ms-excel");
//response.setContentType("application/vnd.ms-excel");
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
response.setCharacterEncoding("utf-8");
this.init(null, sheetName, Type.IMPORT);
exportExcel(response.getOutputStream());