Merge branch 'refs/heads/hotfix/shop'
Showing
3 changed files
with
8 additions
and
5 deletions
@@ -25,10 +25,6 @@ exports.index = (req, res, next) => { | @@ -25,10 +25,6 @@ exports.index = (req, res, next) => { | ||
25 | _.isEmpty(req.query) ? null : req.query)); | 25 | _.isEmpty(req.query) ? null : req.query)); |
26 | } | 26 | } |
27 | 27 | ||
28 | - if (isNaN(+shopId)) { | ||
29 | - return res.redirect(301, '/404'); | ||
30 | - } | ||
31 | - | ||
32 | if (req.xhr && req.query._pjax && shopId) { | 28 | if (req.xhr && req.query._pjax && shopId) { |
33 | return req.ctx(shopModel).getShopGoodsData(shopId, req.yoho.channel, req.query).then(result => { | 29 | return req.ctx(shopModel).getShopGoodsData(shopId, req.yoho.channel, req.query).then(result => { |
34 | Object.assign(result, { | 30 | Object.assign(result, { |
@@ -351,6 +351,13 @@ function getShopInfoAsync(domain, channel, params) { | @@ -351,6 +351,13 @@ function getShopInfoAsync(domain, channel, params) { | ||
351 | let data, shopInfo; | 351 | let data, shopInfo; |
352 | 352 | ||
353 | if (shopId) { // 带id访问 | 353 | if (shopId) { // 带id访问 |
354 | + if (isNaN(+shopId)) { | ||
355 | + return { | ||
356 | + redirect: '/404', | ||
357 | + redirectType: 301 | ||
358 | + }; | ||
359 | + } | ||
360 | + | ||
354 | let result = yield this.api.getShopInfo(shopId); | 361 | let result = yield this.api.getShopInfo(shopId); |
355 | 362 | ||
356 | data = result.data || {}; | 363 | data = result.data || {}; |
-
Please register or login to post a comment