Authored by yyq

mobile refer

... ... @@ -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();
... ...