Authored by 郭成尧

添加catch

... ... @@ -24,13 +24,13 @@ module.exports = {
},
/* 获取品牌列表数据 */
getBrandList: (req, res) => {
getBrandList: (req, res, next) => {
brandModel.getBrandListData({
channel: req.query.channel || req.cookies._Channel || 'men'
}).then(result => {
res.json(result);
});
}).catch(next);
},
/* 全部分类 */
... ... @@ -42,13 +42,13 @@ module.exports = {
},
// 全部分类api
getCateList: (req, res) => {
getCateList: (req, res, next) => {
let params = req.query;
brandModel.getCateListData(params)
.then(result => {
res.json(result);
});
}).catch(next);
},
// 品类资源位
... ...
... ... @@ -20,17 +20,17 @@ module.exports = {
},
/* 获取品牌店铺介绍 */
getShopInfo: (req, res) => {
getShopInfo: (req, res, next) => {
shopModel.getShopData({
domain: req.query.domain,
uid: req.user.uid
}).then(result => {
res.json(result);
});
}).catch(next);
},
/* 获取商品列表 */
getBrandShopGoods: (req, res) => {
getBrandShopGoods: (req, res, next) => {
let filter = req.body.filter || {};
shopModel.getBrandShopGoodsData({
... ... @@ -50,11 +50,11 @@ module.exports = {
tagsFilter: filter.tagsFilter
}).then(result => {
res.json(result);
});
}).catch(next);
},
/* 收藏店铺 */
collectShop: (req, res) => {
collectShop: (req, res, next) => {
shopModel.collectShopData({
shopId: req.body.shopId,
favId: req.body.favId,
... ... @@ -65,7 +65,7 @@ module.exports = {
isFav: req.body.isFav
}).then(result => {
res.json(result);
});
}).catch(next);
},
/* 品牌店铺分享页面 */
... ...