Przeglądaj źródła

修复附件删除bug

laiguoran 4 lat temu
rodzic
commit
0027e43848
1 zmienionych plików z 2 dodań i 2 usunięć
  1. 2 2
      app/controller/material_controller.js

+ 2 - 2
app/controller/material_controller.js

@@ -633,14 +633,14 @@ module.exports = app => {
                     }
                     const fileInfo = path.parse(stream.filename);
                     // const filepath = path.join('public/upload', this.ctx.tender.id.toString(), 'tc', 'fujian_' + create_time + fileInfo.ext);
-                    const filepath = `public/upload/${this.ctx.tender.id.toString()}/tc/fujian_${create_time + idx + fileInfo.ext}`;
+                    const filepath = `public/upload/${this.ctx.tender.id.toString()}/tc/fujian_${create_time + idx.toString() + fileInfo.ext}`;
                     await ctx.helper.saveStreamFile(stream, path.join(this.app.baseDir, 'app', filepath));
 
                     if (stream) {
                         await sendToWormhole(stream);
                     }
                     files.push({ filepath, name: stream.filename });
-                    idx++;
+                    ++idx;
                 }
                 const upload_time = this.ctx.helper.dateTran(new Date());
                 const payload = files.map(file => {