Authored by weiqingting

formart

... ... @@ -18,17 +18,17 @@ const helpers = global.yoho.helpers;
exports.getUser=(req, res, next)=>{
let uid=req.user.uid,result={
isStudent:false
};
exports.getUser = (req, res, next)=>{
let uid = req.user.uid, result = {
isStudent: false
};
detailModel.getUserProfile(uid).then((data)=>{
result.isStudent= data.data && data.data.vip_info && data.data.vip_info.is_student ? true : false
req.__User__=result;
result.isStudent = data.data && data.data.vip_info && data.data.vip_info.is_student ? true : false;
req.__User__ = result;
next();
}).catch(next);
}
};
/**
* 商品基本信息
... ...
... ... @@ -684,5 +684,5 @@ let getProductData = (data) => {
module.exports = {
getProductData,
getUserProfile:_getUserProfile
getUserProfile: _getUserProfile
};
... ...
... ... @@ -27,7 +27,7 @@ const recommendForYou = require(`${cRoot}/recommend-for-you`);
// routers
// /pro_136349_455445/HEARTSOFARMianMaShuJiaoXiuXianKuPS1684.html
router.get(/\/pro_([\d]+)_([\d]+)\/(.*)/, detail.getUser,detail.index); // 商品详情页
router.get(/\/pro_([\d]+)_([\d]+)\/(.*)/, detail.getUser, detail.index); // 商品详情页
// /show_51047967.html
router.get(/\/show_([\d]+)/, detail.getUser, detail.indexSkn); // 商品详情页 SKN 进入
router.get('/detail/intro/:productskn', detail.intro); // 商品内嵌页
... ...