Authored by 郝肖肖

下单联盟修复

... ... @@ -180,14 +180,23 @@ exports.orderSub = (req, res) => {
let userAgent = null;
let unionKey = '';
let unionInfo = {};
let testQyhUnion = {};
if (req.cookies.mkt_code || req.cookies._QYH_UNION) {
/*
*1、http://union.yohobuy.com/go?client_id=3415&aid=0118&channel=3415&cid=3601&wi=NDgwMDB8dGVzdA==&target=http://m.yohobuy.com/
*2、http://union.yoho.cn/union/jump?channel_id=51fanli&u_id=6&tracking_code=fanli123&target_url=http%3a%2f%2fm.yohobuy.com%3funion_type%3d3063%26utm_source%3dmfanli%26utm_medium%3dcps%26utm_campaign%3dmpfanli
**/
/* tar modified 161108 添加新的联盟数据处理逻辑,兼容原有联盟数据处理,
区别是旧的北京写 cookie 加密过来,新的 node 写 cookie,没有加密 */
if (req.cookies._QYH_UNION) {
let encryData = decodeURI(req.cookies._QYH_UNION);
let testQyhUnion = JSON.parse(encryData);
try {
let encryData = crypto.decrypt('', decodeURIComponent(req.cookies._QYH_UNION));
encryData = encryData.substr(0, encryData.lastIndexOf('}') + 1);
testQyhUnion = JSON.parse(encryData);
} catch (e) {
testQyhUnion = {};
}
if (testQyhUnion.client_id) {
unionKey = encryData;
... ...