fix 修复 不同网段因reset请求头导致下载导出跨域问题
This commit is contained in:
parent
111db70908
commit
6281ec0456
@ -100,7 +100,6 @@ public class SysOssController extends BaseController {
|
|||||||
if (ObjectUtil.isNull(sysOss)) {
|
if (ObjectUtil.isNull(sysOss)) {
|
||||||
throw new ServiceException("文件数据不存在!");
|
throw new ServiceException("文件数据不存在!");
|
||||||
}
|
}
|
||||||
response.reset();
|
|
||||||
FileUtils.setAttachmentResponseHeader(response, sysOss.getOriginalName());
|
FileUtils.setAttachmentResponseHeader(response, sysOss.getOriginalName());
|
||||||
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE + "; charset=UTF-8");
|
response.setContentType(MediaType.APPLICATION_OCTET_STREAM_VALUE + "; charset=UTF-8");
|
||||||
long data;
|
long data;
|
||||||
|
@ -194,7 +194,6 @@ public class ExcelUtil {
|
|||||||
*/
|
*/
|
||||||
private static void resetResponse(String sheetName, HttpServletResponse response) throws UnsupportedEncodingException {
|
private static void resetResponse(String sheetName, HttpServletResponse response) throws UnsupportedEncodingException {
|
||||||
String filename = encodingFilename(sheetName);
|
String filename = encodingFilename(sheetName);
|
||||||
response.reset();
|
|
||||||
FileUtils.setAttachmentResponseHeader(response, filename);
|
FileUtils.setAttachmentResponseHeader(response, filename);
|
||||||
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8");
|
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8");
|
||||||
}
|
}
|
||||||
|
@ -196,7 +196,6 @@ public class GenController extends BaseController {
|
|||||||
* 生成zip文件
|
* 生成zip文件
|
||||||
*/
|
*/
|
||||||
private void genCode(HttpServletResponse response, byte[] data) throws IOException {
|
private void genCode(HttpServletResponse response, byte[] data) throws IOException {
|
||||||
response.reset();
|
|
||||||
response.addHeader("Access-Control-Allow-Origin", "*");
|
response.addHeader("Access-Control-Allow-Origin", "*");
|
||||||
response.addHeader("Access-Control-Expose-Headers", "Content-Disposition");
|
response.addHeader("Access-Control-Expose-Headers", "Content-Disposition");
|
||||||
response.setHeader("Content-Disposition", "attachment; filename=\"ruoyi.zip\"");
|
response.setHeader("Content-Disposition", "attachment; filename=\"ruoyi.zip\"");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user