lrf402788946 4 éve
szülő
commit
d91ad2339b
1 módosított fájl, 4 hozzáadás és 2 törlés
  1. 4 2
      app/service/util.js

+ 4 - 2
app/service/util.js

@@ -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}`;
   }