📝 fix: 修改excel和core配置
This commit is contained in:
parent
bf24b8a7e5
commit
fcf35bd12b
@ -41,6 +41,7 @@ public class CorsConfig implements WebMvcConfigurer {
|
|||||||
.allowedMethods("GET", "POST", "DELETE", "PUT")
|
.allowedMethods("GET", "POST", "DELETE", "PUT")
|
||||||
// 设置允许的header属性
|
// 设置允许的header属性
|
||||||
.allowedHeaders("*")
|
.allowedHeaders("*")
|
||||||
|
.exposedHeaders("*")
|
||||||
// 跨域允许时间
|
// 跨域允许时间
|
||||||
.maxAge(3600);
|
.maxAge(3600);
|
||||||
}
|
}
|
||||||
|
@ -41,6 +41,7 @@ public class ExcelUtils {
|
|||||||
Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), pojoClass, list);
|
Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), pojoClass, list);
|
||||||
response.setCharacterEncoding("UTF-8");
|
response.setCharacterEncoding("UTF-8");
|
||||||
response.setHeader("content-Type", "application/vnd.ms-excel");
|
response.setHeader("content-Type", "application/vnd.ms-excel");
|
||||||
|
response.setHeader("Access-Control-Expose-Headers","Content-Disposition");
|
||||||
response.setHeader("Content-Disposition",
|
response.setHeader("Content-Disposition",
|
||||||
"attachment;filename=" + URLEncoder.encode(fileName, "UTF-8") + ".xls");
|
"attachment;filename=" + URLEncoder.encode(fileName, "UTF-8") + ".xls");
|
||||||
ServletOutputStream out = response.getOutputStream();
|
ServletOutputStream out = response.getOutputStream();
|
||||||
|
Loading…
Reference in New Issue
Block a user