Merge branch 'main' of https://gitea.frp.extimaging.com/XCKJ/irc_web into main
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
commit
23fb7be52b
|
|
@ -14,6 +14,7 @@ function zipFiles(zipName, files) {
|
||||||
let zipFileOutputStream = streamSaver.createWriteStream(zipName);
|
let zipFileOutputStream = streamSaver.createWriteStream(zipName);
|
||||||
// 创建下载文件流
|
// 创建下载文件流
|
||||||
const fileIterator = files.values();
|
const fileIterator = files.values();
|
||||||
|
let Url = null;
|
||||||
let readableZipStream = new ZIP({
|
let readableZipStream = new ZIP({
|
||||||
async pull(ctrl) {
|
async pull(ctrl) {
|
||||||
const fileInfo = fileIterator.next();
|
const fileInfo = fileIterator.next();
|
||||||
|
|
@ -23,6 +24,7 @@ function zipFiles(zipName, files) {
|
||||||
let { name, url, IsEncapsulated = false } = fileInfo.value;
|
let { name, url, IsEncapsulated = false } = fileInfo.value;
|
||||||
if (IsEncapsulated) {
|
if (IsEncapsulated) {
|
||||||
url = await downloadFileToUrl(url)
|
url = await downloadFileToUrl(url)
|
||||||
|
Url = url
|
||||||
}
|
}
|
||||||
// url = decodeUtf8(url); // 待定,可能做过特殊处理
|
// url = decodeUtf8(url); // 待定,可能做过特殊处理
|
||||||
return fetch(url).then(res => {
|
return fetch(url).then(res => {
|
||||||
|
|
@ -43,14 +45,28 @@ function zipFiles(zipName, files) {
|
||||||
store.dispatch('trials/setUnLock', false)
|
store.dispatch('trials/setUnLock', false)
|
||||||
readableZipStream = null;
|
readableZipStream = null;
|
||||||
zipFileOutputStream = null;
|
zipFileOutputStream = null;
|
||||||
|
if (Url) {
|
||||||
|
URL.revokeObjectURL(Url)
|
||||||
|
Url = null
|
||||||
|
}
|
||||||
resolve(true)
|
resolve(true)
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
console.log(err);
|
console.log(err);
|
||||||
readableZipStream = null;
|
readableZipStream = null;
|
||||||
zipFileOutputStream = null;
|
zipFileOutputStream = null;
|
||||||
|
if (Url) {
|
||||||
|
URL.revokeObjectURL(Url)
|
||||||
|
Url = null
|
||||||
|
}
|
||||||
resolve(false)
|
resolve(false)
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
readableZipStream = null;
|
||||||
|
zipFileOutputStream = null;
|
||||||
|
if (Url) {
|
||||||
|
URL.revokeObjectURL(Url)
|
||||||
|
Url = null
|
||||||
|
}
|
||||||
resolve(false)
|
resolve(false)
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue