From 5d73bc771f19bb2b307868064613ce489ed18e1e Mon Sep 17 00:00:00 2001 From: duandazhi Date: Mon, 15 Mar 2021 23:23:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=8B=E8=BD=BD=E7=9A=84mi?= =?UTF-8?q?metype,=20=E7=9B=AE=E5=89=8Dexcel=20mimetype=E6=98=AF=20doc,?= =?UTF-8?q?=E5=85=BC=E5=AE=B9=E6=80=A7=E6=AF=94=E8=BE=83=E5=B7=AE=E5=9C=A8?= =?UTF-8?q?macos=20=E4=B8=8B=E8=BD=BDexcel=E6=96=87=E4=BB=B6=E7=9B=B4?= =?UTF-8?q?=E6=8E=A5=E5=8F=98=E6=88=90=E4=BA=86=20xlw=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E4=BA=86=EF=BC=8C=E5=BB=BA=E8=AE=AE=E5=8D=87=E7=BA=A7=20excel?= =?UTF-8?q?=20mimetype=20=E5=88=B0=20excel2007=20+=20;=20=E8=AF=A6?= =?UTF-8?q?=E8=A7=A3=EF=BC=9Adocx=E3=80=81xlsx=20=E8=BF=99=E7=A7=8D=20offi?= =?UTF-8?q?ce=202007=20=E6=A0=BC=E5=BC=8F=20=E8=AE=BE=E7=BD=AE=20MIME?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/ruoyi/common/core/utils/poi/ExcelUtil.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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..68cbb6bf 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 @@ -322,6 +322,7 @@ public class ExcelUtil public void exportExcel(HttpServletResponse response, List list, String sheetName) throws IOException { 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());