Authored by 陈峰

Merge branch 'hotfix/mobileRefer' into 'gray'

Hotfix/mobile refer

mobile refer

See merge request !196
... ... @@ -6,8 +6,9 @@ const querystring = require('querystring');
module.exports = () => {
return (req, res, next) => {
if (req.isMobile) {
return res.redirect(req.mobileUrl || `//m.yohobuy.com${req.url}?${querystring.stringify(req.query)}`);
if (!req.xhr && req.isMobile) {
return res.redirect(req.mobileUrl || res.locals.mobileRefer ||
`//m.yohobuy.com${req.url}?${querystring.stringify(req.query)}`);
}
return next();
... ...