Authored by 李奇

Merge remote-tracking branch 'origin/feature/coupons-expansion' into feature/activity-image-upload

... ... @@ -98,7 +98,7 @@ const couponExp = {
const coupons = req.session._EXP_COUPONS;
let promises = _.map(_.filter(coupons, cp => !cp.user_send), item => {
let promises = _.map(coupons, item => {
return req.ctx(expModel).getCoupon(uid, item.couponId);
});
... ... @@ -161,7 +161,7 @@ const couponExp = {
req.session.yh_auth_uid = uid;
req.session.yh_auth_logged = true;
let promises = _.map(_.filter(coupons, cp => !cp.user_send), item => {
let promises = _.map(coupons, item => {
return req.ctx(expModel).getCoupon(uid, item.couponId);
});
... ... @@ -180,6 +180,21 @@ const couponExp = {
},
/**
* 清除登录状态
* @param req
* @param res
*/
clearYhLogin(req, res) {
req.session.yh_auth_uid = 0;
req.session.yh_auth_logged = false;
res.json({
code: 200,
message: '已清除有货授权登录状态'
});
},
/**
* 助力好友
* @param req
* @param res
... ...
... ... @@ -11,6 +11,7 @@ router.get('/couponExp/couponList', couponExp.couponList);
router.post('/couponExp/receiveCoupon', couponExp.receiveCoupon);
router.post('/couponExp/progress', couponExp.progress);
router.get('/couponExp/yhLoginSuccess', couponExp.yhLoginSuccess);
router.post('/couponExp/clearYhLogin', couponExp.clearYhLogin);
router.post('/couponExp/friendHelp', couponExp.friendHelp);
module.exports = router;
... ...