Skip to content

Commit

Permalink
Merge pull request #48 from twelvet-s/master-1
Browse files Browse the repository at this point in the history
跨域无法获取到后端返回的Content-Disposition文件名称
  • Loading branch information
lltx authored Aug 8, 2023
2 parents 0cae52a + 6df4c8e commit eacf48b
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ public void export(Object o, HttpServletResponse response, ResponseExcel respons
.map(MediaType::toString)
.orElse("application/vnd.ms-excel");
response.setContentType(contentType);
response.setHeader(HttpHeaders.ACCESS_CONTROL_EXPOSE_HEADERS, HttpHeaders.CONTENT_DISPOSITION);
response.setCharacterEncoding("utf-8");
response.setHeader(HttpHeaders.CONTENT_DISPOSITION, "attachment;filename*=utf-8''" + fileName);
write(o, response, responseExcel);
Expand Down

0 comments on commit eacf48b

Please sign in to comment.