Authored by yyq

异常处理

... ... @@ -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);
};
... ...