Selaa lähdekoodia

📝 fix: 修改excel和core配置

pull/1/head
weihongyang 2 vuotta sitten
vanhempi
commit
fcf35bd12b
2 muutettua tiedostoa jossa 2 lisäystä ja 0 poistoa
  1. +1
    -0
      ym-admin/src/main/java/com/cnbm/admin/config/CorsConfig.java
  2. +1
    -0
      ym-common/src/main/java/com/cnbm/common/utils/ExcelUtils.java

+ 1
- 0
ym-admin/src/main/java/com/cnbm/admin/config/CorsConfig.java Näytä tiedosto

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


+ 1
- 0
ym-common/src/main/java/com/cnbm/common/utils/ExcelUtils.java Näytä tiedosto

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


Ladataan…
Peruuta
Tallenna