...
|
...
|
@@ -5,6 +5,7 @@ const semver = require('semver'); |
|
|
const questionModel = require('../models/question');
|
|
|
const headerModel = require('../../../doraemon/models/header'); // 头部model
|
|
|
const geetest = require('../../passport/controllers/geetest');
|
|
|
const cleanHtml = require('../../../utils/cleanHtml');
|
|
|
|
|
|
exports.list = (req, res, next) => {
|
|
|
let canShare = false;
|
...
|
...
|
@@ -92,6 +93,15 @@ exports.submit = (req, res, next) => { |
|
|
params.sourceType = 'PC';
|
|
|
}
|
|
|
|
|
|
let frontAnswers = JSON.parse(params.frontAnswers || '[]') || [];
|
|
|
|
|
|
_.each(frontAnswers, item => {
|
|
|
if (item.addon) {
|
|
|
item.addon = cleanHtml.htmlEncode(item.addon);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
params.frontAnswers = JSON.stringify(frontAnswers);
|
|
|
req.ctx(questionModel).submitQuestion(params).then(result => {
|
|
|
res.send(result);
|
|
|
}).catch(next);
|
...
|
...
|
|