...
|
...
|
@@ -2,10 +2,12 @@ |
|
|
* 手机访问检测
|
|
|
*/
|
|
|
'use strict';
|
|
|
const querystring = require('querystring');
|
|
|
|
|
|
module.exports = () => {
|
|
|
return (req, res, next) => {
|
|
|
if (req.isMobile) {
|
|
|
return res.redirect(req.mobileUrl || `//m.yohobuy.com${req.url}`);
|
|
|
return res.redirect(req.mobileUrl || `//m.yohobuy.com${req.url}?${querystring.stringify(req.query)}`);
|
|
|
}
|
|
|
|
|
|
return next();
|
...
|
...
|
|