|
@@ -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 {
|