Authored by yyq

router

... ... @@ -10,7 +10,7 @@ const TYPE = require('../type');
module.exports = [
{
type: TYPE.redirect,
origin: /\/about\?shopId=([\d]+)/,
origin: /^\/about\?shopId=([\d]+)/,
target: (req, match, id) => {
return helpers.urlFormat(`/shop${id}-about`, null, req.subdomains[0]);
}
... ...
... ... @@ -139,7 +139,7 @@ module.exports = [
},
{
type: TYPE.rewrite,
origin: /\/(.*)-new/,
origin: /^\/(.*)-new/,
target: (req, match, channel) => {
return `/product/list/${channel}-new`;
}
... ...
... ... @@ -102,7 +102,7 @@ module.exports = [
// 新品到着
{
type: TYPE.rewrite,
origin: /\/(.*)-new/,
origin: /^\/(.*)-new/,
target: (req, match, channel) => {
return `/product/list/${channel}-new`;
}
... ... @@ -179,7 +179,7 @@ module.exports = [
},
{
type: TYPE.rewrite,
origin: /\/shop([\d]+)-about/,
origin: /^\/shop([\d]+)-about/,
target: (req, match, id) => {
req.query.domain = req.subdomains[0];
req.query.shopId = id;
... ...