Commit 2f522f2e authored by 任国军's avatar 任国军

generateReport add cat_id check

parent 5705436a
Pipeline #22205 passed with stage
in 2 minutes 13 seconds
......@@ -52,6 +52,12 @@ class ReportService extends Service {
const { ctx } = this;
const data = eval(input.data);
// 校验cat_id
const category = await ctx.classModel.V5.CourseV5Category.findOne({ where: { id: input.cat_id } });
if (ctx.isEmpty(category) || category.type !== 3) {
ctx.failed('cat_id error');
}
let answerIds = [];
for (const v of data) {
answerIds = _.concat(answerIds, v.answers);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment