Showing
3 changed files
with
7 additions
and
7 deletions
@@ -164,12 +164,12 @@ module.exports={ | @@ -164,12 +164,12 @@ module.exports={ | ||
164 | return callback(null, result); | 164 | return callback(null, result); |
165 | }, | 165 | }, |
166 | exportExcel:function(req, callback){ | 166 | exportExcel:function(req, callback){ |
167 | + var headers=Utils.createHttpHeader(req); | ||
168 | + headers['content-type']='application/json'; | ||
167 | var result = request({ | 169 | var result = request({ |
168 | method: 'POST', | 170 | method: 'POST', |
169 | url: config.domain + '/batch/export', | 171 | url: config.domain + '/batch/export', |
170 | - headers: { | ||
171 | - 'content-type': 'application/json' | ||
172 | - }, | 172 | + headers: headers, |
173 | body: req.query, | 173 | body: req.query, |
174 | json: true | 174 | json: true |
175 | }); | 175 | }); |
@@ -141,7 +141,7 @@ module.exports = { | @@ -141,7 +141,7 @@ module.exports = { | ||
141 | var path = req.route?req.route.path[0]:req.originalUrl.replace(/\?.+/, ''); | 141 | var path = req.route?req.route.path[0]:req.originalUrl.replace(/\?.+/, ''); |
142 | req._yoheaders = { | 142 | req._yoheaders = { |
143 | 'x-user-id': user.auth.pid, | 143 | 'x-user-id': user.auth.pid, |
144 | - 'x-user-name': user.auth.account, | 144 | + 'x-user-name': user.auth.account,//防止header中包含中文 |
145 | 'x-site-type': Iaccount.WEBSITE, | 145 | 'x-site-type': Iaccount.WEBSITE, |
146 | 'x-client-ip': req.ip, | 146 | 'x-client-ip': req.ip, |
147 | 'x-shop-id': user.auth.shopId | 147 | 'x-shop-id': user.auth.shopId |
@@ -164,12 +164,12 @@ module.exports={ | @@ -164,12 +164,12 @@ module.exports={ | ||
164 | return callback(null, result); | 164 | return callback(null, result); |
165 | }, | 165 | }, |
166 | exportExcel:function(req, callback){ | 166 | exportExcel:function(req, callback){ |
167 | + var headers=Utils.createHttpHeader(req); | ||
168 | + headers['content-type']='application/json'; | ||
167 | var result = request({ | 169 | var result = request({ |
168 | method: 'POST', | 170 | method: 'POST', |
169 | url: config.domain + '/batch/export', | 171 | url: config.domain + '/batch/export', |
170 | - headers: { | ||
171 | - 'content-type': 'application/json' | ||
172 | - }, | 172 | + headers: headers, |
173 | body: req.query, | 173 | body: req.query, |
174 | json: true | 174 | json: true |
175 | }); | 175 | }); |
-
Please register or login to post a comment