...
|
...
|
@@ -365,15 +365,7 @@ const favoriteBrand = (req, res, next) => { |
|
|
let opt = req.query.opt || 'ok';
|
|
|
let type = req.query.type || 'product';
|
|
|
let appVersion = req.query.appVersion || false;
|
|
|
let refer = req.headers.origin;
|
|
|
|
|
|
if (req.headers.referer) {
|
|
|
let refererSplit = _.split(req.headers.referer, '?');
|
|
|
|
|
|
if (id) {
|
|
|
refer = refererSplit[0] + '?shop_id=' + id;
|
|
|
}
|
|
|
}
|
|
|
let refer = req.get('referer');
|
|
|
|
|
|
let url = helpers.urlFormat('/signin.html') + '?refer=' + refer;
|
|
|
|
...
|
...
|
@@ -385,6 +377,7 @@ const favoriteBrand = (req, res, next) => { |
|
|
}
|
|
|
|
|
|
url = `${refer}&openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"${refer}","param":{}},"requesturl":{"param":{"method":"app.favorite.add","id":"${id}","fav_id":"${id}","type":"shop"},"url":"${_.get(global, 'yoho.API.ApiUrl', '')}"},"priority":"Y"}}`; // eslint-disable-line
|
|
|
|
|
|
}
|
|
|
|
|
|
if (!id) {
|
...
|
...
|
@@ -476,23 +469,7 @@ const userCoupon = (req, res, next) => { |
|
|
return;
|
|
|
}).catch(next);
|
|
|
} else {
|
|
|
let refer = req.headers.origin;
|
|
|
|
|
|
if (req.headers.referer) {
|
|
|
let refererSplit = _.split(req.headers.referer, '?');
|
|
|
|
|
|
let shopIdSplit = _.split(refererSplit[1], '&');
|
|
|
let shopId = '';
|
|
|
|
|
|
_.forEach(shopIdSplit, value => {
|
|
|
if (_.startsWith(value, 'shop_id')) {
|
|
|
shopId = value;
|
|
|
return;
|
|
|
}
|
|
|
});
|
|
|
|
|
|
refer = refererSplit[0] + '?' + shopId;
|
|
|
}
|
|
|
let refer = req.get('referer');
|
|
|
|
|
|
if (req.yoho.isApp !== 'false') {
|
|
|
let toUrl = refer + '&openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"' +
|
...
|
...
|
|