Преглед на файлове

报表,uat和prod导出Excel问题

MaiXinRong преди 5 години
родител
ревизия
868b2e0e07
променени са 1 файла, в които са добавени 1 реда и са изтрити 4 реда
  1. 1 4
      app/controller/report_controller.js

+ 1 - 4
app/controller/report_controller.js

@@ -385,14 +385,11 @@ module.exports = app => {
                 const filePath = this.app.baseDir + '/app/public/download/';
                 // console.log('filePath: ' + filePath);
                 // await this.ctx.helper.recursiveMkdirSync(this.app.baseDir + '/app/public/download');
-                const filestream = fs.createReadStream(filePath + uuid + suffix);
-                const chunk = await getUuidFile(filestream);
                 ctx.set({
                     'Content-Type': 'application/vnd.openxmlformats',
                     'Content-Disposition': 'attachment; filename="' + rptNameURI + suffix + "\"; filename*=utf-8''" + rptNameURI + suffix,
-                    'Content-Length': chunk.length,
                 });
-                ctx.body = chunk;
+                ctx.body = await fs.readFileSync(filePath + uuid + suffix);
             } catch (e) {
                 console.log(e);
             }