Merge branch 'hotfix/yasvd' into 'master'
唯一设备号 See merge request !458
Showing
6 changed files
with
34 additions
and
27 deletions
@@ -182,7 +182,6 @@ exports.orderSub = (req, res, next) => { | @@ -182,7 +182,6 @@ exports.orderSub = (req, res, next) => { | ||
182 | let yohoCoin = req.body.yohoCoin || 0; | 182 | let yohoCoin = req.body.yohoCoin || 0; |
183 | let skuList = req.body.skuList || ''; | 183 | let skuList = req.body.skuList || ''; |
184 | let orderInfo; | 184 | let orderInfo; |
185 | - let isWechat = req.yoho.isWechat; | ||
186 | 185 | ||
187 | try { | 186 | try { |
188 | orderInfo = JSON.parse(req.cookies['order-info']); | 187 | orderInfo = JSON.parse(req.cookies['order-info']); |
@@ -254,7 +253,15 @@ exports.orderSub = (req, res, next) => { | @@ -254,7 +253,15 @@ exports.orderSub = (req, res, next) => { | ||
254 | 253 | ||
255 | return co(function* () { | 254 | return co(function* () { |
256 | let result; | 255 | let result; |
257 | - let ip = req.ip || ''; | 256 | + |
257 | + // 接口需要的其他参数 | ||
258 | + let otherParams = { | ||
259 | + unionKey: unionKey, // 友盟数据 | ||
260 | + userAgent: userAgent, | ||
261 | + isWechat: req.yoho.isWechat, | ||
262 | + ip: req.ip || '', | ||
263 | + udid: req.cookies._yasvd || 'yoho' | ||
264 | + }; | ||
258 | 265 | ||
259 | /* tar modified 161206 套餐 */ | 266 | /* tar modified 161206 套餐 */ |
260 | if (req.body.cartType === 'bundle') { | 267 | if (req.body.cartType === 'bundle') { |
@@ -262,11 +269,11 @@ exports.orderSub = (req, res, next) => { | @@ -262,11 +269,11 @@ exports.orderSub = (req, res, next) => { | ||
262 | 269 | ||
263 | result = yield cartModel.orderSub(uid, addressId, 'bundle', deliveryTimeId, | 270 | result = yield cartModel.orderSub(uid, addressId, 'bundle', deliveryTimeId, |
264 | deliveryId, invoices, paymentTypeId, paymentType, msg, couponCode, | 271 | deliveryId, invoices, paymentTypeId, paymentType, msg, couponCode, |
265 | - yohoCoin, null, unionKey, userAgent, times, activityInfo, ip, isWechat); | 272 | + yohoCoin, null, times, activityInfo, otherParams); |
266 | } else { | 273 | } else { |
267 | result = yield cartModel.orderSub(uid, addressId, cartType, deliveryTimeId, | 274 | result = yield cartModel.orderSub(uid, addressId, cartType, deliveryTimeId, |
268 | deliveryId, invoices, paymentTypeId, paymentType, msg, couponCode, | 275 | deliveryId, invoices, paymentTypeId, paymentType, msg, couponCode, |
269 | - yohoCoin, skuList, unionKey, userAgent, null, null, ip, isWechat); | 276 | + yohoCoin, skuList, null, null, otherParams); |
270 | } | 277 | } |
271 | 278 | ||
272 | // 提交成功清除Cookie | 279 | // 提交成功清除Cookie |
@@ -180,23 +180,21 @@ exports.ticketsOrderCompute = (uid, productSku, buyNumber, yohoCoin) => { | @@ -180,23 +180,21 @@ exports.ticketsOrderCompute = (uid, productSku, buyNumber, yohoCoin) => { | ||
180 | * @param string $couponCode 优惠券码 | 180 | * @param string $couponCode 优惠券码 |
181 | * @param mixed $yohoCoin 使用的有货币数量或为空 | 181 | * @param mixed $yohoCoin 使用的有货币数量或为空 |
182 | * @param string $skuList 购买限购商品时需要传递的参数 | 182 | * @param string $skuList 购买限购商品时需要传递的参数 |
183 | - * @param string $qhyUnio 友盟有关信息 | ||
184 | * @param string|null $userAgent 联盟过来用户下单时需要的User-Agent信息 | 183 | * @param string|null $userAgent 联盟过来用户下单时需要的User-Agent信息 |
185 | * @param int $times | 184 | * @param int $times |
186 | * @param null $activityInfo 套餐数据 | 185 | * @param null $activityInfo 套餐数据 |
187 | - * @param isWechat 是否是微信商城 | 186 | + * @param otherParams 其他参数 |
188 | * @return array 接口返回的数据 | 187 | * @return array 接口返回的数据 |
189 | */ | 188 | */ |
190 | exports.orderSub = (uid, addressId, cartType, deliveryTime, | 189 | exports.orderSub = (uid, addressId, cartType, deliveryTime, |
191 | deliveryWay, invoices, paymentId, paymentType, remark, | 190 | deliveryWay, invoices, paymentId, paymentType, remark, |
192 | - couponCode, yohoCoin, skuList, qhyUnio, | ||
193 | - userAgent, times, activityInfo, ip, isWechat) => { | ||
194 | - if (!qhyUnio) { | ||
195 | - qhyUnio = ''; | 191 | + couponCode, yohoCoin, skuList, times, activityInfo, otherParams) => { |
192 | + if (!otherParams.unionKey) { | ||
193 | + otherParams.unionKey = ''; | ||
196 | } | 194 | } |
197 | 195 | ||
198 | - if (!userAgent) { | ||
199 | - userAgent = null; | 196 | + if (!otherParams.userAgent) { |
197 | + otherParams.userAgent = null; | ||
200 | } | 198 | } |
201 | 199 | ||
202 | if (!times) { | 200 | if (!times) { |
@@ -221,8 +219,7 @@ exports.orderSub = (uid, addressId, cartType, deliveryTime, | @@ -221,8 +219,7 @@ exports.orderSub = (uid, addressId, cartType, deliveryTime, | ||
221 | 219 | ||
222 | return shoppingAPI.orderSub(uid, addressId, cartType, deliveryTime, | 220 | return shoppingAPI.orderSub(uid, addressId, cartType, deliveryTime, |
223 | deliveryWay, invoices, paymentId, paymentType, | 221 | deliveryWay, invoices, paymentId, paymentType, |
224 | - remark, couponCode, yohoCoin, skuList, qhyUnio, | ||
225 | - userAgent, times, activityInfo, ip, isWechat).then(orderSubRes => { | 222 | + remark, couponCode, yohoCoin, skuList, times, activityInfo, otherParams).then(orderSubRes => { |
226 | let finalResult = {}; | 223 | let finalResult = {}; |
227 | 224 | ||
228 | if (orderSubRes && orderSubRes.data && orderSubRes.data.is_hint === 'Y') { | 225 | if (orderSubRes && orderSubRes.data && orderSubRes.data.is_hint === 'Y') { |
@@ -149,16 +149,15 @@ exports.checkTickets = (uid, productSku, buyNumber, useYohoCoin, yohoCoinMode) = | @@ -149,16 +149,15 @@ exports.checkTickets = (uid, productSku, buyNumber, useYohoCoin, yohoCoinMode) = | ||
149 | * @param string $couponCode 优惠券码 | 149 | * @param string $couponCode 优惠券码 |
150 | * @param mixed $yohoCoin 使用的有货币数量或为空 | 150 | * @param mixed $yohoCoin 使用的有货币数量或为空 |
151 | * @param string $skuList 购买限购商品时需要传递的参数 | 151 | * @param string $skuList 购买限购商品时需要传递的参数 |
152 | - * @param string $qhyUnion 友盟有关信息 | ||
153 | * @param string|null $userAgent 联盟过来用户下单时需要的User-Agent信息 | 152 | * @param string|null $userAgent 联盟过来用户下单时需要的User-Agent信息 |
154 | * @param $times | 153 | * @param $times |
155 | * @param null $activityInfo 套餐信息 | 154 | * @param null $activityInfo 套餐信息 |
156 | - * @param isWechat 是否是微信商城 | 155 | + * @param @param otherParams 其他参数 |
157 | * @return array 接口返回的数据 | 156 | * @return array 接口返回的数据 |
158 | */ | 157 | */ |
159 | exports.orderSub = (uid, addressId, cartType, deliveryTime, | 158 | exports.orderSub = (uid, addressId, cartType, deliveryTime, |
160 | deliveryWay, invoices, paymentId, paymentType, remark, couponCode, | 159 | deliveryWay, invoices, paymentId, paymentType, remark, couponCode, |
161 | - yohoCoin, skuList, qhyUnion, userAgent, times, activityInfo, ip, isWechat) => { | 160 | + yohoCoin, skuList, times, activityInfo, otherParams) => { |
162 | if (!activityInfo) { | 161 | if (!activityInfo) { |
163 | activityInfo = null; | 162 | activityInfo = null; |
164 | } | 163 | } |
@@ -173,7 +172,8 @@ exports.orderSub = (uid, addressId, cartType, deliveryTime, | @@ -173,7 +172,8 @@ exports.orderSub = (uid, addressId, cartType, deliveryTime, | ||
173 | payment_id: paymentId, | 172 | payment_id: paymentId, |
174 | payment_type: paymentType, | 173 | payment_type: paymentType, |
175 | remark: remark, | 174 | remark: remark, |
176 | - uid: uid | 175 | + uid: uid, |
176 | + udid: otherParams.udid | ||
177 | }; | 177 | }; |
178 | 178 | ||
179 | /* tar add 161130 结算优化 */ | 179 | /* tar add 161130 结算优化 */ |
@@ -223,19 +223,19 @@ exports.orderSub = (uid, addressId, cartType, deliveryTime, | @@ -223,19 +223,19 @@ exports.orderSub = (uid, addressId, cartType, deliveryTime, | ||
223 | } | 223 | } |
224 | 224 | ||
225 | // 友盟有关信息的传递 | 225 | // 友盟有关信息的传递 |
226 | - if (qhyUnion) { | ||
227 | - params.qhy_union = qhyUnion; | 226 | + if (otherParams.unionKey) { |
227 | + params.qhy_union = otherParams.unionKey; | ||
228 | } | 228 | } |
229 | 229 | ||
230 | // 是否是微信商城 | 230 | // 是否是微信商城 |
231 | - if (isWechat) { | 231 | + if (otherParams.isWechat) { |
232 | params.client_type = 'wechat'; | 232 | params.client_type = 'wechat'; |
233 | } | 233 | } |
234 | 234 | ||
235 | return api.post('', params, { | 235 | return api.post('', params, { |
236 | headers: { | 236 | headers: { |
237 | - 'X-Forwarded-For': ip || '', | ||
238 | - 'User-Agent': userAgent | 237 | + 'X-Forwarded-For': otherParams.ip || '', |
238 | + 'User-Agent': otherParams.userAgent | ||
239 | } | 239 | } |
240 | }); | 240 | }); |
241 | }; | 241 | }; |
@@ -188,6 +188,7 @@ const addressModify = (req, res, next) => { | @@ -188,6 +188,7 @@ const addressModify = (req, res, next) => { | ||
188 | */ | 188 | */ |
189 | const changeAddress = (req, res, next) => { | 189 | const changeAddress = (req, res, next) => { |
190 | let uid = req.user.uid; | 190 | let uid = req.user.uid; |
191 | + let udid = req.cookies._yasvd || 'yoho'; | ||
191 | 192 | ||
192 | if (!uid) { | 193 | if (!uid) { |
193 | return res.json({ | 194 | return res.json({ |
@@ -202,7 +203,8 @@ const changeAddress = (req, res, next) => { | @@ -202,7 +203,8 @@ const changeAddress = (req, res, next) => { | ||
202 | username: req.body.username, | 203 | username: req.body.username, |
203 | areaCode: req.body.area_code, | 204 | areaCode: req.body.area_code, |
204 | address: req.body.address, | 205 | address: req.body.address, |
205 | - mobile: req.body.mobile | 206 | + mobile: req.body.mobile, |
207 | + udid: udid | ||
206 | }).then(result => { | 208 | }).then(result => { |
207 | res.json(result); | 209 | res.json(result); |
208 | }).catch(next); | 210 | }).catch(next); |
@@ -374,7 +374,8 @@ const changeAddress = (params) => { | @@ -374,7 +374,8 @@ const changeAddress = (params) => { | ||
374 | user_name: params.username, | 374 | user_name: params.username, |
375 | area_code: params.areaCode, | 375 | area_code: params.areaCode, |
376 | address: params.address, | 376 | address: params.address, |
377 | - mobile: params.mobile | 377 | + mobile: params.mobile, |
378 | + udid: params.udid | ||
378 | }; | 379 | }; |
379 | 380 | ||
380 | if (params.addressId) { | 381 | if (params.addressId) { |
@@ -13,8 +13,8 @@ const domains = { | @@ -13,8 +13,8 @@ const domains = { | ||
13 | liveApi: 'http://testapi.live.yohops.com:9999/', | 13 | liveApi: 'http://testapi.live.yohops.com:9999/', |
14 | singleApi: 'http://api-test3.yohops.com:9999/', | 14 | singleApi: 'http://api-test3.yohops.com:9999/', |
15 | 15 | ||
16 | - api: 'http://api-test3.yohops.com:9999/', | ||
17 | - service: 'http://service-test3.yohops.com:9999/', | 16 | + api: 'http://api-test2.yohops.com:9999/', |
17 | + service: 'http://service-test2.yohops.com:9999/', | ||
18 | 18 | ||
19 | // liveApi: 'http://api.live.yoho.cn/', | 19 | // liveApi: 'http://api.live.yoho.cn/', |
20 | // singleApi: 'http://single.yoho.cn/', | 20 | // singleApi: 'http://single.yoho.cn/', |
-
Please register or login to post a comment