Authored by 郭成尧

qhy_union

... ... @@ -154,8 +154,9 @@ class BuyNowController {
* @param {*} next
*/
orderSub(req, res, next) {
let uid = req.user.uid;
let params = {
uid: req.user.uid,
uid: uid,
product_sku: req.body.product_sku,
sku_type: req.body.sku_type,
buy_number: req.body.buy_number,
... ... @@ -186,6 +187,10 @@ class BuyNowController {
}
}
if (req.cookies.mkt_code || req.cookies._QYH_UNION) {
params.qhy_union = paymentProcess.unionInfoHandle(req.cookies, uid);
}
co(function * () {
let result = yield req.ctx(BuyNowModel).submit(params);
... ...
... ... @@ -159,6 +159,10 @@ class BuyNowModel extends global.yoho.BaseModel {
finalParams.promotion_code = params.promotion_code;
}
if (params.qhy_union) {
finalParams.qhy_union = params.qhy_union;
}
return api.post('', finalParams, {cache: false});
}
... ...
... ... @@ -443,8 +443,10 @@ function unionInfoHandle(cookies, uid) {
}
/* 模拟APP的User-Agent */
userAgent = clientId ? 'YOHO!Buy/3.8.2.259(Model/PC;Channel/' +
clientId + ';uid/' + uid + ')' : null;
let clientIdSub = _.split(clientId, ',')[0];
userAgent = clientIdSub ? 'YOHO!Buy/3.8.2.259(Model/H5;Channel/' +
clientIdSub + ';uid/' + uid + ')' : null;
return {
unionKey: unionKey,
... ...