Authored by yyq

mobile refer

... ... @@ -22,7 +22,7 @@ const _handleImageUrl = (url) => {
}
return url;
}
};
const _setHotKeywordData = (result, params, channel) => {
let changeQuery = Object.assign({}, params);
... ...
... ... @@ -43,6 +43,7 @@ module.exports = () => {
return (req, res, next) => {
let domain = 'm.yohobuy.com';
let proRegNew = /^\/product\/([\d]+).html(.*)/;
let hotReg = /^\/hot\/([\d]+).html(.*)/;
if (!req.xhr) {
let url = _.head(_.split(req.url, '?'));
... ... @@ -56,6 +57,8 @@ module.exports = () => {
data.mobileRefer = `//${domain}/guang?${queryString.stringify(req.query)}`;
} else if (proRegNew.test(url)) {
data.mobileRefer = url.replace(proRegNew, `//${domain}/product/$1.html$2`);
} else if (hotReg) {
data.mobileRefer = `//${domain}/mip${url}`;
}
// 设置不需要跳转页面
... ...