📝 fix: 修改excel和core配置

This commit is contained in:
weihongyang 2022-08-18 10:34:23 +08:00
父節點 bf24b8a7e5
當前提交 fcf35bd12b
共有 2 個檔案被更改,包括 2 行新增0 行删除

查看文件

@ -41,6 +41,7 @@ public class CorsConfig implements WebMvcConfigurer {
.allowedMethods("GET", "POST", "DELETE", "PUT")
// 设置允许的header属性
.allowedHeaders("*")
.exposedHeaders("*")
// 跨域允许时间
.maxAge(3600);
}

查看文件

@ -41,6 +41,7 @@ public class ExcelUtils {
Workbook workbook = ExcelExportUtil.exportExcel(new ExportParams(), pojoClass, list);
response.setCharacterEncoding("UTF-8");
response.setHeader("content-Type", "application/vnd.ms-excel");
response.setHeader("Access-Control-Expose-Headers","Content-Disposition");
response.setHeader("Content-Disposition",
"attachment;filename=" + URLEncoder.encode(fileName, "UTF-8") + ".xls");
ServletOutputStream out = response.getOutputStream();