Showing
1 changed file
with
14 additions
and
14 deletions
@@ -50,22 +50,22 @@ module.exports = class extends global.yoho.BaseModel { | @@ -50,22 +50,22 @@ module.exports = class extends global.yoho.BaseModel { | ||
50 | ]).then(result => { | 50 | ]).then(result => { |
51 | let resData = {}; | 51 | let resData = {}; |
52 | 52 | ||
53 | - if (_.get(result, '[0].code', '') !== 200) { | ||
54 | - resData.errText = _.get(result, '[0].message', '哟,本次调研已经飞走了,请移步其他调研呗!'); | ||
55 | - } | 53 | + if (_.get(result, '[0].code', '') === 200) { |
54 | + let data = _.get(result, '[1].data', {}); | ||
56 | 55 | ||
57 | - let data = _.get(result, '[1].data', {}); | ||
58 | - | ||
59 | - if (data.questions) { | ||
60 | - _.forEach(data.questions, value => { | ||
61 | - if (+value.questionType === 3) { | ||
62 | - value.questionContents = _.fill(Array(value.fillBlankNum || 1), true); | ||
63 | - } | ||
64 | - }); | ||
65 | - } | 56 | + if (data.questions) { |
57 | + _.forEach(data.questions, value => { | ||
58 | + if (+value.questionType === 3) { | ||
59 | + value.questionContents = _.fill(Array(value.fillBlankNum || 1), true); | ||
60 | + } | ||
61 | + }); | ||
62 | + } | ||
66 | 63 | ||
67 | - if (!_.isEmpty(data)) { | ||
68 | - resData.detail = data; | 64 | + if (!_.isEmpty(data)) { |
65 | + resData.detail = data; | ||
66 | + } | ||
67 | + } else { | ||
68 | + resData.errText = _.get(result, '[0].message', '哟,本次调研已经飞走了,请移步其他调研呗!'); | ||
69 | } | 69 | } |
70 | 70 | ||
71 | return resData; | 71 | return resData; |
-
Please register or login to post a comment