|
@@ -278,21 +278,23 @@ class UtilService extends CrudService {
|
|
|
}
|
|
|
if (uri && filename) resetFileList.push({ uri, filename });
|
|
|
}
|
|
|
- console.log(resetFileList);
|
|
|
// 导出
|
|
|
+ console.log(`${path}${fn}`);
|
|
|
const output = fs.createWriteStream(`${path}${fn}`);
|
|
|
const archive = archiver('zip', {
|
|
|
zlib: { level: 9 },
|
|
|
});
|
|
|
+ archive.pipe(output);
|
|
|
// 请求文件,追加进压缩包
|
|
|
for (const file of resetFileList) {
|
|
|
const { uri, filename } = file;
|
|
|
const res = await this.ctx.curl(`http://127.0.0.1${uri}`);
|
|
|
if (res && res.data) {
|
|
|
+ console.log('in function:append');
|
|
|
archive.append(res.data, filename);
|
|
|
}
|
|
|
}
|
|
|
- archive.pipe(output);
|
|
|
+ console.log('before finalize');
|
|
|
archive.finalize();
|
|
|
return `/files${zipPath}${fn}`;
|
|
|
}
|