From 7d874e31cfa42163fe448a6d742a805492359fc1 Mon Sep 17 00:00:00 2001
From: Zeno <15270656234@163.com>
Date: 星期一, 28 十一月 2022 18:29:38 +0800
Subject: [PATCH] update ruoyi-ui/src/plugins/download.js. 修复文件名包含特殊字符(+、-、*...)的文件无法下载问题
---
ruoyi-ui/src/plugins/download.js | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/ruoyi-ui/src/plugins/download.js b/ruoyi-ui/src/plugins/download.js
index 86e2031..a3bb8c4 100644
--- a/ruoyi-ui/src/plugins/download.js
+++ b/ruoyi-ui/src/plugins/download.js
@@ -9,7 +9,7 @@
export default {
name(name, isDelete = true) {
- var url = baseURL + "/common/download?fileName=" + encodeURI(name) + "&delete=" + isDelete
+ var url = baseURL + "/common/download?fileName=" + encodeURIComponent(name) + "&delete=" + isDelete
axios({
method: 'get',
url: url,
@@ -19,14 +19,14 @@
const isLogin = await blobValidate(res.data);
if (isLogin) {
const blob = new Blob([res.data])
- this.saveAs(blob, decodeURI(res.headers['download-filename']))
+ this.saveAs(blob, decodeURIComponent(res.headers['download-filename']))
} else {
this.printErrMsg(res.data);
}
})
},
resource(resource) {
- var url = baseURL + "/common/download/resource?resource=" + encodeURI(resource);
+ var url = baseURL + "/common/download/resource?resource=" + encodeURIComponent(resource);
axios({
method: 'get',
url: url,
@@ -36,7 +36,7 @@
const isLogin = await blobValidate(res.data);
if (isLogin) {
const blob = new Blob([res.data])
- this.saveAs(blob, decodeURI(res.headers['download-filename']))
+ this.saveAs(blob, decodeURIComponent(res.headers['download-filename']))
} else {
this.printErrMsg(res.data);
}
--
Gitblit v1.9.2