Authored by ccbikai

增加 商品 ID 检查

... ... @@ -50,15 +50,19 @@ exports.index = (req, res, next) => {
* @param {[type]} res [description]
* @return {[type]} [description]
*/
exports.intro = (req, res) => {
introModel({
exports.intro = (req, res, next) => {
if (!req.params.productskn) {
return next();
}
introModel.getintroData({
productskn: req.params.productskn
}).then((result) => {
}, req).then((result) => {
res.render('detail/intro', {
result: result,
layout: false
});
});
}).catch(next);
};
/**
... ...
... ... @@ -319,16 +319,20 @@ const getSizeInfo = (sizeInfo) => {
return dest;
};
module.exports = (data) => {
let getintroData = (data, req) => {
var finalResult;
return api.get('', {
method: 'h5.product.intro',
productskn: data.productskn,
udid: 'f528764d624db129b32c21fbca0cb8d6'
udid: req.sessionID || 'yoho'
}).then(result => {
finalResult = getSizeInfo(result);
return finalResult;
});
};
module.exports = {
getintroData
};
... ...