From 984098abcea78bd603520c12eb5f1ce8c92d5b81 Mon Sep 17 00:00:00 2001 From: phanes <5411232+phanes@user.noreply.gitee.com> Date: 星期二, 16 十一月 2021 20:47:26 +0800 Subject: [PATCH] fix: 修复返回参数的数据类型错误的问题 --- ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java index 5df2923..ff56a2a 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java @@ -22,9 +22,6 @@ * @return */ public static void setAttachmentResponseHeader(HttpServletResponse response, String realFileName) throws UnsupportedEncodingException { - response.addHeader("Access-Control-Allow-Origin", "*"); - response.addHeader("Access-Control-Expose-Headers", "Content-Disposition,download-filename"); - String percentEncodedFileName = percentEncode(realFileName); StringBuilder contentDispositionValue = new StringBuilder(); @@ -35,6 +32,8 @@ .append("utf-8''") .append(percentEncodedFileName); + response.addHeader("Access-Control-Allow-Origin", "*"); + response.addHeader("Access-Control-Expose-Headers", "Content-Disposition,download-filename"); response.setHeader("Content-disposition", contentDispositionValue.toString()); response.setHeader("download-filename", percentEncodedFileName); } -- Gitblit v1.9.3