|
|
@@ -114,6 +114,12 @@ module.exports = app => {
|
|
|
}
|
|
|
}
|
|
|
const preData = await ctx.service.stageBonus.getPreStageData(ctx.stage.order);
|
|
|
+ for (const d of preData) {
|
|
|
+ for (const pf of d.proof_file) {
|
|
|
+ delete pf.filepath;
|
|
|
+ pf.username = (await ctx.service.projectAccount.getAccountInfoById(pf.uid)).name;
|
|
|
+ }
|
|
|
+ }
|
|
|
ctx.body = {err: 0, msg: '', data: data.concat(preData)};
|
|
|
} catch (error) {
|
|
|
ctx.helper.log(error);
|
|
|
@@ -203,7 +209,7 @@ module.exports = app => {
|
|
|
throw '未发现上传文件!';
|
|
|
}
|
|
|
if (!bonus) bonus = await ctx.service.stageBonus.getStageDataById(parts.field.bonus_id);
|
|
|
- if (!bonus) throw '该奖罚金,当前不允许上传附件';
|
|
|
+ if (!bonus || bonus.sid !== ctx.stage.id) throw '该奖罚金,当前不允许上传附件';
|
|
|
|
|
|
const fileInfo = path.parse(stream.filename);
|
|
|
const dirName = 'app/public/upload/extra/' + moment().format('YYYYMMDD');
|