Merge branch 'feature/cusService-api-sign' into 'gray'
Feature/cus service api sign 保存评价接口空参数过滤 See merge request !396
Showing
3 changed files
with
17 additions
and
16 deletions
@@ -143,13 +143,22 @@ exports.fetchOrders = (req, res) => { | @@ -143,13 +143,22 @@ exports.fetchOrders = (req, res) => { | ||
143 | }; | 143 | }; |
144 | 144 | ||
145 | exports.saveEvalute = (req, res) => { | 145 | exports.saveEvalute = (req, res) => { |
146 | - const encryptedUid = req.body.encryptedUid; | ||
147 | - const conversationId = req.body.conversationId; | ||
148 | - const promoter = req.body.promoter; | ||
149 | - const stars = req.body.stars; | ||
150 | - const reasonMsg = req.body.reasonMsg || ''; | 146 | + const params = {}; |
147 | + | ||
148 | + params.encryptedUid = req.body.encryptedUid; | ||
149 | + params.conversationId = req.body.conversationId; | ||
150 | + params.promoter = req.body.promoter; | ||
151 | + params.stars = req.body.stars; | ||
152 | + | ||
153 | + if(req.body.reasonIds) { | ||
154 | + params.reasonIds = req.body.reasonIds; | ||
155 | + } | ||
156 | + | ||
157 | + if(req.body.reasonMsg) { | ||
158 | + params.reasonMsg = req.body.reasonMsg; | ||
159 | + } | ||
151 | 160 | ||
152 | - imApi.saveEvalute(encryptedUid, conversationId, promoter, stars, reasonMsg) | 161 | + imApi.saveEvalute(params) |
153 | .then(result => { | 162 | .then(result => { |
154 | return res.json(result); | 163 | return res.json(result); |
155 | }).catch(() => { | 164 | }).catch(() => { |
@@ -105,15 +105,7 @@ exports.fetchOrderList = (encryptedUid, createTimeBegin) => { | @@ -105,15 +105,7 @@ exports.fetchOrderList = (encryptedUid, createTimeBegin) => { | ||
105 | | reasonMsg | string | N | 其他原因 | | 105 | | reasonMsg | string | N | 其他原因 | |
106 | 106 | ||
107 | */ | 107 | */ |
108 | -exports.saveEvalute = (encryptedUid, conversationId, promoter, stars, reasonMsg) => { | ||
109 | - let params = { | ||
110 | - conversationId, | ||
111 | - encryptedUid, | ||
112 | - promoter, | ||
113 | - stars, | ||
114 | - reasonMsg | ||
115 | - }; | ||
116 | - | 108 | +exports.saveEvalute = (params) => { |
117 | return ImService.post('/api/evalute/saveEvalute', params); | 109 | return ImService.post('/api/evalute/saveEvalute', params); |
118 | }; | 110 | }; |
119 | 111 |
@@ -209,7 +209,7 @@ RatingView.prototype = $.extend({}, EventEmitter.prototype, { | @@ -209,7 +209,7 @@ RatingView.prototype = $.extend({}, EventEmitter.prototype, { | ||
209 | stars: ++this.rank, | 209 | stars: ++this.rank, |
210 | promoter: 1, | 210 | promoter: 1, |
211 | reasonIds: '', | 211 | reasonIds: '', |
212 | - reasonMsg: elem.find('.words-to-say').val(), | 212 | + reasonMsg: elem.find('.words-to-say').val().trim(), |
213 | }; | 213 | }; |
214 | 214 | ||
215 | let temp = []; | 215 | let temp = []; |
-
Please register or login to post a comment