Authored by 郭成尧

Merge branch 'qCloud' of git.yoho.cn:fe/yohobuywap-node into qCloud

@@ -61,10 +61,6 @@ exports.status = (req, res, next) => { @@ -61,10 +61,6 @@ exports.status = (req, res, next) => {
61 }; 61 };
62 62
63 exports.receive = (req, res, next) => { 63 exports.receive = (req, res, next) => {
64 - let receiveData = {  
65 - couponID: req.query.couponID  
66 - };  
67 -  
68 let uid = ''; 64 let uid = '';
69 65
70 if (req.yoho.isApp) { 66 if (req.yoho.isApp) {
@@ -73,7 +69,16 @@ exports.receive = (req, res, next) => { @@ -73,7 +69,16 @@ exports.receive = (req, res, next) => {
73 uid = req.user.uid; 69 uid = req.user.uid;
74 } 70 }
75 71
76 - model.receiveCoupon(receiveData, uid).then(result => { 72 + if (!uid) {
  73 + return res.json({
  74 + code: 400,
  75 + message: '抱歉,您暂未登录!'
  76 + });
  77 + }
  78 +
  79 + model.receiveCoupon({
  80 + couponID: req.query.couponID
  81 + }, uid).then(result => {
77 res.json(result); 82 res.json(result);
78 }).catch(next); 83 }).catch(next);
79 -}; 84 +};
@@ -34,7 +34,7 @@ router.get('/coupon/floor', couponFloor.index); @@ -34,7 +34,7 @@ router.get('/coupon/floor', couponFloor.index);
34 34
35 router.get('/coupon/status', couponFloor.status); 35 router.get('/coupon/status', couponFloor.status);
36 36
37 -router.get('/coupon/receiveCoupon', auth, couponFloor.receive); 37 +router.get('/coupon/receiveCoupon', couponFloor.receive);
38 38
39 router.get('/student', student.getUser, student.index); 39 router.get('/student', student.getUser, student.index);
40 40
@@ -87,4 +87,4 @@ router.get('/vip-day/msg/fetch.json', vipDay.fetchMsg); @@ -87,4 +87,4 @@ router.get('/vip-day/msg/fetch.json', vipDay.fetchMsg);
87 87
88 88
89 89
90 -module.exports = router; 90 +module.exports = router;