Authored by 郭成尧

添加catch

@@ -24,13 +24,13 @@ module.exports = { @@ -24,13 +24,13 @@ module.exports = {
24 }, 24 },
25 25
26 /* 获取品牌列表数据 */ 26 /* 获取品牌列表数据 */
27 - getBrandList: (req, res) => { 27 + getBrandList: (req, res, next) => {
28 28
29 brandModel.getBrandListData({ 29 brandModel.getBrandListData({
30 channel: req.query.channel || req.cookies._Channel || 'men' 30 channel: req.query.channel || req.cookies._Channel || 'men'
31 }).then(result => { 31 }).then(result => {
32 res.json(result); 32 res.json(result);
33 - }); 33 + }).catch(next);
34 }, 34 },
35 35
36 /* 全部分类 */ 36 /* 全部分类 */
@@ -42,13 +42,13 @@ module.exports = { @@ -42,13 +42,13 @@ module.exports = {
42 }, 42 },
43 43
44 // 全部分类api 44 // 全部分类api
45 - getCateList: (req, res) => { 45 + getCateList: (req, res, next) => {
46 let params = req.query; 46 let params = req.query;
47 47
48 brandModel.getCateListData(params) 48 brandModel.getCateListData(params)
49 .then(result => { 49 .then(result => {
50 res.json(result); 50 res.json(result);
51 - }); 51 + }).catch(next);
52 }, 52 },
53 53
54 // 品类资源位 54 // 品类资源位
@@ -20,17 +20,17 @@ module.exports = { @@ -20,17 +20,17 @@ module.exports = {
20 }, 20 },
21 21
22 /* 获取品牌店铺介绍 */ 22 /* 获取品牌店铺介绍 */
23 - getShopInfo: (req, res) => { 23 + getShopInfo: (req, res, next) => {
24 shopModel.getShopData({ 24 shopModel.getShopData({
25 domain: req.query.domain, 25 domain: req.query.domain,
26 uid: req.user.uid 26 uid: req.user.uid
27 }).then(result => { 27 }).then(result => {
28 res.json(result); 28 res.json(result);
29 - }); 29 + }).catch(next);
30 }, 30 },
31 31
32 /* 获取商品列表 */ 32 /* 获取商品列表 */
33 - getBrandShopGoods: (req, res) => { 33 + getBrandShopGoods: (req, res, next) => {
34 let filter = req.body.filter || {}; 34 let filter = req.body.filter || {};
35 35
36 shopModel.getBrandShopGoodsData({ 36 shopModel.getBrandShopGoodsData({
@@ -50,11 +50,11 @@ module.exports = { @@ -50,11 +50,11 @@ module.exports = {
50 tagsFilter: filter.tagsFilter 50 tagsFilter: filter.tagsFilter
51 }).then(result => { 51 }).then(result => {
52 res.json(result); 52 res.json(result);
53 - }); 53 + }).catch(next);
54 }, 54 },
55 55
56 /* 收藏店铺 */ 56 /* 收藏店铺 */
57 - collectShop: (req, res) => { 57 + collectShop: (req, res, next) => {
58 shopModel.collectShopData({ 58 shopModel.collectShopData({
59 shopId: req.body.shopId, 59 shopId: req.body.shopId,
60 favId: req.body.favId, 60 favId: req.body.favId,
@@ -65,7 +65,7 @@ module.exports = { @@ -65,7 +65,7 @@ module.exports = {
65 isFav: req.body.isFav 65 isFav: req.body.isFav
66 }).then(result => { 66 }).then(result => {
67 res.json(result); 67 res.json(result);
68 - }); 68 + }).catch(next);
69 }, 69 },
70 70
71 /* 品牌店铺分享页面 */ 71 /* 品牌店铺分享页面 */