Showing
2 changed files
with
14 additions
and
4 deletions
@@ -41,8 +41,16 @@ exports.index = (req, res, next) => { | @@ -41,8 +41,16 @@ exports.index = (req, res, next) => { | ||
41 | logger.debug(`decodeURIComponent query fail:${e.toString()}`); | 41 | logger.debug(`decodeURIComponent query fail:${e.toString()}`); |
42 | } | 42 | } |
43 | 43 | ||
44 | + let channel = req.query.channel || 'boys'; | ||
45 | + | ||
46 | + if (req.url.indexOf('gd2') > -1) { | ||
47 | + channel = 'girls'; | ||
48 | + } else if (req.url.indexOf('gd1') > -1) { | ||
49 | + channel = 'boys'; | ||
50 | + } | ||
51 | + | ||
44 | req.ctx(list).getListData(Object.assign(req.query, {uid: req.user.uid, prid: req.user.prid}), | 52 | req.ctx(list).getListData(Object.assign(req.query, {uid: req.user.uid, prid: req.user.prid}), |
45 | - req.yoho.channel).then(result => { | 53 | + channel || req.yoho.channel).then(result => { |
46 | Object.assign(resData, result, { | 54 | Object.assign(resData, result, { |
47 | pageClass: 'static-list-page' | 55 | pageClass: 'static-list-page' |
48 | }); | 56 | }); |
@@ -77,8 +85,10 @@ exports.index = (req, res, next) => { | @@ -77,8 +85,10 @@ exports.index = (req, res, next) => { | ||
77 | */ | 85 | */ |
78 | exports.new = (req, res, next) => { | 86 | exports.new = (req, res, next) => { |
79 | let resData = {}; | 87 | let resData = {}; |
88 | + const channel = req.query.channel || 'boys'; | ||
80 | 89 | ||
81 | - req.ctx(list).getListNewData(Object.assign({order: 's_t_desc'}, req.query), req.yoho.channel).then(result => { | 90 | + // eslint-disable-next-line max-len |
91 | + req.ctx(list).getListNewData(Object.assign({order: 's_t_desc'}, req.query), channel || req.yoho.channel).then(result => { | ||
82 | Object.assign(resData, result, { | 92 | Object.assign(resData, result, { |
83 | hideInfo: {from: 'newProduct'}, | 93 | hideInfo: {from: 'newProduct'}, |
84 | pageClass: 'static-list-page' | 94 | pageClass: 'static-list-page' |
@@ -100,7 +110,7 @@ exports.new = (req, res, next) => { | @@ -100,7 +110,7 @@ exports.new = (req, res, next) => { | ||
100 | * @return {[type]} [description] | 110 | * @return {[type]} [description] |
101 | */ | 111 | */ |
102 | exports.newWithChannel = (req, res, next) => { | 112 | exports.newWithChannel = (req, res, next) => { |
103 | - let channel = req.pathChannel || req.yoho.channel; | 113 | + let channel = req.query.channel || req.pathChannel || req.yoho.channel; |
104 | 114 | ||
105 | req.query = req.query || {}; | 115 | req.query = req.query || {}; |
106 | 116 |
-
Please register or login to post a comment