📝 fix: 修改excel和core配置

This commit is contained in:
weihongyang 2022-08-18 10:34:23 +08:00
parent bf24b8a7e5
commit fcf35bd12b
2 ha cambiato i file con 2 aggiunte e 0 eliminazioni

Vedi File

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

Vedi File

@ -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();