Authored by 沈志敏

去掉auth

... ... @@ -61,10 +61,6 @@ exports.status = (req, res, next) => {
};
exports.receive = (req, res, next) => {
let receiveData = {
couponID: req.query.couponID
};
let uid = '';
if (req.yoho.isApp) {
... ... @@ -73,7 +69,16 @@ exports.receive = (req, res, next) => {
uid = req.user.uid;
}
model.receiveCoupon(receiveData, uid).then(result => {
if (!uid) {
return res.json({
code: 400,
message: '抱歉,您暂未登录!'
});
}
model.receiveCoupon({
couponID: req.query.couponID
}, uid).then(result => {
res.json(result);
}).catch(next);
};
};
\ No newline at end of file
... ...
... ... @@ -34,7 +34,7 @@ router.get('/coupon/floor', couponFloor.index);
router.get('/coupon/status', couponFloor.status);
router.get('/coupon/receiveCoupon', auth, couponFloor.receive);
router.get('/coupon/receiveCoupon', couponFloor.receive);
router.get('/student', student.getUser, student.index);
... ... @@ -87,4 +87,4 @@ router.get('/vip-day/msg/fetch.json', vipDay.fetchMsg);
module.exports = router;
module.exports = router;
\ No newline at end of file
... ...