Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
RuoYi Vue
Commits
158e883e
Commit
158e883e
authored
Feb 25, 2022
by
xueye
Browse files
fix: 修复文件下载跨域问题
parent
e62e8e37
Changes
1
Hide whitespace changes
Inline
Side-by-side
ruoyi-common/src/main/java/com/ruoyi/common/utils/file/FileUtils.java
View file @
158e883e
...
...
@@ -196,7 +196,6 @@ public class FileUtils
*
* @param response 响应对象
* @param realFileName 真实文件名
* @return
*/
public
static
void
setAttachmentResponseHeader
(
HttpServletResponse
response
,
String
realFileName
)
throws
UnsupportedEncodingException
{
...
...
@@ -210,7 +209,6 @@ public class FileUtils
.
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
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment