...
|
...
|
@@ -59,11 +59,19 @@ exports.status = (req, res, next) => { |
|
|
|
|
|
exports.receive = (req, res, next) => {
|
|
|
let app = req.query.app;
|
|
|
let uid = req.user.uid;
|
|
|
|
|
|
if (!uid) {
|
|
|
return res.jsonp({
|
|
|
code: 400,
|
|
|
message: '抱歉,您暂未登录!'
|
|
|
});
|
|
|
}
|
|
|
|
|
|
// 接口要加 session 校验,跨域异步请求未添加相关参数
|
|
|
if (req.yoho.isApp) {
|
|
|
if (app.app_version && app.client_type && app.session_key && app.uid) {
|
|
|
req.user.uid = {
|
|
|
uid = req.user.uid = {
|
|
|
toString: () => {
|
|
|
return _.parseInt(app.uid);
|
|
|
},
|
...
|
...
|
@@ -74,8 +82,6 @@ exports.receive = (req, res, next) => { |
|
|
}
|
|
|
}
|
|
|
|
|
|
let uid = req.user.uid;
|
|
|
|
|
|
req.ctx(model).receiveCoupon({
|
|
|
couponID: req.query.couponID
|
|
|
}, uid).then(result => {
|
...
|
...
|
|