diff --git a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/poi/ExcelUtil.java b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/poi/ExcelUtil.java index f754a2ca..95c73be9 100644 --- a/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/poi/ExcelUtil.java +++ b/ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/utils/poi/ExcelUtil.java @@ -321,7 +321,8 @@ public class ExcelUtil */ public void exportExcel(HttpServletResponse response, List 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 */ 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());