|
@@ -762,7 +762,7 @@ module.exports = app => {
|
|
|
|
|
|
// 保存文件
|
|
|
// await ctx.helper.saveStreamFile(stream, path.join(this.app.baseDir, dirName, fileName));
|
|
|
- await ctx.app.fujianOss.put(filepath, stream);
|
|
|
+ await ctx.app.fujianOss.put(ctx.app.config.fujianOssFolder + filepath, stream);
|
|
|
await sendToWormhole(stream);
|
|
|
|
|
|
// 插入到stage_pay对应的附件列表中
|
|
@@ -1456,7 +1456,7 @@ module.exports = app => {
|
|
|
const create_time = Date.parse(new Date()) / 1000;
|
|
|
const filepath = `app/public/upload/${this.ctx.tender.id}/stage/fujian_${create_time + index.toString() + fileInfo.ext}`;
|
|
|
// await ctx.helper.saveStreamFile(stream, path.resolve(this.app.baseDir, filepath));
|
|
|
- await ctx.app.fujianOss.put(filepath, stream);
|
|
|
+ await ctx.app.fujianOss.put(ctx.app.config.fujianOssFolder + filepath, stream);
|
|
|
// console.log(await fs.existsSync(path.resolve(this.app.baseDir, 'app', filepath)));
|
|
|
// const fileInfo = path.parse(stream.filename);
|
|
|
// const fileName = 'stage' + create_time + '_' + index + fileInfo.ext;
|
|
@@ -1600,7 +1600,7 @@ module.exports = app => {
|
|
|
if (fileInfo !== undefined && fileInfo !== '') {
|
|
|
// 先删除文件
|
|
|
// await fs.unlinkSync(path.join(this.app.baseDir, fileInfo.filepath));
|
|
|
- await ctx.app.fujianOss.delete(fileInfo.filepath);
|
|
|
+ await ctx.app.fujianOss.delete(ctx.app.config.fujianOssFolder + fileInfo.filepath);
|
|
|
// 再删除数据库
|
|
|
await ctx.service.stageAtt.deleteById(data.id);
|
|
|
responseData.data = '';
|
|
@@ -1646,7 +1646,7 @@ module.exports = app => {
|
|
|
|
|
|
// 保存文件
|
|
|
// await ctx.helper.saveStreamFile(stream, path.join(this.app.baseDir, dirName, fileName));
|
|
|
- await ctx.app.fujianOss.put(path.join(dirName, fileName), stream);
|
|
|
+ await ctx.app.fujianOss.put(ctx.app.config.fujianOssFolder + path.join(dirName, fileName), stream);
|
|
|
// 保存数据到att表
|
|
|
fileData = {
|
|
|
filesize: stream.fields.size,
|
|
@@ -1771,7 +1771,7 @@ module.exports = app => {
|
|
|
// }
|
|
|
// 保存文件
|
|
|
// await ctx.helper.saveStreamFile(stream, path.join(this.app.baseDir, dirName, fileName));
|
|
|
- await ctx.app.fujianOss.put(filepath, stream);
|
|
|
+ await ctx.app.fujianOss.put(ctx.app.config.fujianOssFolder + filepath, stream);
|
|
|
await sendToWormhole(stream);
|
|
|
// 插入到stage_pay对应的附件列表中
|
|
|
const attData = {
|
|
@@ -1851,7 +1851,7 @@ module.exports = app => {
|
|
|
const data = JSON.parse(ctx.request.body.data);
|
|
|
const fileInfo = await ctx.service.payAtt.getDataById(data.id);
|
|
|
if (!fileInfo) throw '不存在该文件';
|
|
|
- await ctx.app.fujianOss.delete(fileInfo.filepath);
|
|
|
+ await ctx.app.fujianOss.delete(ctx.app.config.fujianOssFolder + fileInfo.filepath);
|
|
|
const result = await ctx.service.payAtt.delFiles(data.id);
|
|
|
// if (fs.existsSync(path.join(ctx.app.baseDir, fileInfo.filepath))) {
|
|
|
// await fs.unlinkSync(path.join(ctx.app.baseDir, fileInfo.filepath));
|