|
@@ -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
|
}; |