Explorar o código

附件地址更新

laiguoran %!s(int64=3) %!d(string=hai) anos
pai
achega
be2c36b3e4
Modificáronse 1 ficheiros con 2 adicións e 2 borrados
  1. 2 2
      app/controller/material_controller.js

+ 2 - 2
app/controller/material_controller.js

@@ -973,7 +973,7 @@ module.exports = app => {
                     // const filepath = path.join('public/upload', this.ctx.tender.id.toString(), 'tc', 'fujian_' + create_time + fileInfo.ext);
                     const filepath = `app/public/upload/${this.ctx.tender.id.toString()}/tc/fujian_${create_time + idx.toString() + fileInfo.ext}`;
                     // await ctx.helper.saveStreamFile(stream, path.resolve(this.app.baseDir, 'app', filepath));
-                    await ctx.app.fujianOss.put(filepath, stream);
+                    await ctx.app.fujianOss.put(ctx.app.config.fujianOssFolder + filepath, stream);
                     files.push({ filepath, name: stream.filename, ext: fileInfo.ext });
                     ++idx;
                 }
@@ -1085,7 +1085,7 @@ module.exports = app => {
                 if (fileInfo) {
                     // 先删除文件
                     // await fs.unlinkSync(path.resolve(this.app.baseDir, './app', fileInfo.filepath));
-                    await ctx.app.fujianOss.delete(fileInfo.filepath);
+                    await ctx.app.fujianOss.delete(ctx.app.config.fujianOssFolder + fileInfo.filepath);
                     // 再删除数据库
                     await ctx.service.materialFile.delete(id);
                 } else {