Authored by 周少峰

Merge branch 'release/4.6' of http://git.yoho.cn/fe/yohobuy-node into release/4.6

... ... @@ -43,7 +43,7 @@ exports.index = (req, res) => {
* @param {[type]} res [description]
* @return {[type]} [description]
*/
exports.channel = (req, res) => {
exports.channel = (req, res, next) => {
let resData = {
module: 'product',
page: 'outlets'
... ... @@ -51,11 +51,7 @@ exports.channel = (req, res) => {
outlets.getOutletsChannelData(req.query, req.params.channel).then(result => {
res.render('outlets/channel', Object.assign(resData, result));
}).catch((e) => {
log.error(e);
resData.pageErr = true;
res.render('error', resData);
});
}).catch(next);
};
/**
... ... @@ -64,7 +60,7 @@ exports.channel = (req, res) => {
* @param {[type]} res [description]
* @return {[type]} [description]
*/
exports.special = (req, res) => {
exports.special = (req, res, next) => {
let params = req.query;
let channel = req.query.channel || req.cookies._Channel || 'boys';
let resData = {
... ... @@ -78,11 +74,7 @@ exports.special = (req, res) => {
outlets.getOutletsSpecialData(params, channel).then(result => {
res.render('outlets/special', Object.assign(resData, result));
}).catch((e) => {
log.error(e);
resData.pageErr = true;
res.render('error', resData);
});
}).catch(next);
};
/**
... ... @@ -91,7 +83,7 @@ exports.special = (req, res) => {
* @param {[type]} res [description]
* @return {[type]} [description]
*/
exports.list = (req, res) => {
exports.list = (req, res, next) => {
let params = req.query;
let channel = req.query.channel || req.cookies._Channel || 'boys';
... ... @@ -104,12 +96,7 @@ exports.list = (req, res) => {
};
outlets.getOutletsCategoryData(params, channel).then((result) => {
responseData.resultShow = JSON.stringify(result, null, 4);
res.render('sale/other', Object.assign(responseData, result));
}).catch((e) => {
log.error(e);
responseData.pageErr = true;
res.render('error', responseData);
});
}).catch(next);
};
... ...
... ... @@ -204,9 +204,9 @@ exports.getOutletsSpecialData = (params, channel) => {
Object.assign(specialData, result[0]);
specialData.headerData.headType = 'outlets';
// 活动信息获取异常
if (result[1].code !== 200) {
// 活动信息获取异常
throw new Error('fail_to_get_special_info_with_ID:' + params.id);
throw new Error('outlets special info not found-(ID:' + params.id + ')');
}
Object.assign(specialData,
... ...