...
|
...
|
@@ -32,7 +32,7 @@ const ptm = { |
|
|
module.exports = () => {
|
|
|
return (req, res, next) => {
|
|
|
let domain = 'm.yohobuy.com';
|
|
|
let proReg = /^\/product\/pro/,
|
|
|
let proRegNew = /^\/product\/p([\d]+).html(.*)/,
|
|
|
guangReg = /^\/guang/,
|
|
|
guangDetailReg = /\/guang\/info\/index/,
|
|
|
qsReg = /\?/;
|
...
|
...
|
@@ -57,8 +57,8 @@ module.exports = () => { |
|
|
} else if (url === '/guang/Index/editor') {
|
|
|
data.mobileRefer += `/author/index?id=${req.query.author_id}`;
|
|
|
}
|
|
|
} else if (proReg.test(url)) {
|
|
|
data.mobileRefer = `//${domain}${url}`;
|
|
|
} else if (proRegNew.text(url)) {
|
|
|
data.mobileRefer = url.replace(proRegNew, `//${domain}/product/pro_$1_1/1.html$2`);
|
|
|
}
|
|
|
|
|
|
if (!_.isEmpty(req.query) && !qsReg.test(data.mobileRefer)) {
|
...
|
...
|
|