修改文件下载方式,使用StreamingResponseBody,支持大文件下载

This commit is contained in:
WIN-VSNMD38DUOC\Administrator
2024-12-06 17:29:36 +08:00
parent 2ed8e1159c
commit 2e0f8e82a8
3 changed files with 46 additions and 26 deletions

View File

@@ -108,7 +108,7 @@
const fileDown = (obj) => {
const path = obj.getAttribute("value");
window.open(Fmt.ctx() + '/download/execute?path=' + encodeURIComponent(path) + '&temp=' + false);
window.open(Fmt.ctx() + '/download/file?path=' + encodeURIComponent(path) + '&temp=' + false);
};
window.onload = () => {
@@ -139,7 +139,7 @@
};
Fmt.axios(options).then((result) => {
message.update({content: '压缩包' + result.filename + "创建完成,准备下载文件......", result: 'success'}).show();
window.open(Fmt.ctx() + '/download/execute?path=' + encodeURIComponent(result.path) + '&temp=' + true);
window.open(Fmt.ctx() + '/download/file?path=' + encodeURIComponent(result.path) + '&temp=' + true);
}).catch((err) => {
console.log(err);
new axMessage({content: err, result: 'error', iconShow: true}).show();