导出需要设置respone
@GetMapping("/downExcel")
public void downExcel(HttpServletResponse response) throws IOException{
response.setContentType("application/octet-stream;charset=UTF-8");
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode("xxx.xls", "UTF-8"));
response.addHeader("Pargam", "no-cache");
response.addHeader("Cache-Control", "no-cache");
xxxxxx 业务代码
}