Authored by 郭成尧

sub-domain

... ... @@ -9,7 +9,6 @@ const helpers = global.yoho.helpers;
module.exports = () => {
return (req, res, next) => {
console.log();
if (req.subdomains.length) {
switch (req.subdomains[0]) {
case 'guang': // 逛
... ... @@ -24,7 +23,7 @@ module.exports = () => {
break;
case 'sale': // sale
res.redirect(301, helpers.urlFormat('/product/sale', req.query, 'default'));
return;
return;
case 'new': // new.m.yohobuy.com 全部跳转到 m.yohobuy.com
res.redirect(301, helpers.urlFormat(req.path, req.query, 'default'));
return;
... ... @@ -38,4 +37,4 @@ module.exports = () => {
}
next();
};
};
\ No newline at end of file
};
... ...