Authored by 沈志敏

验证用户登录情况

... ... @@ -359,6 +359,20 @@ const alipay = {
}
};
exports.user = function(req, res, next) {
let result = {
code: 403,
message: '未登录',
data: ''
}
if (req.user.uid) {
result.code = 200;
result.message = '已登录';
result.data = req.user.uid;
}
res.jsonp(result);
}
exports.common = common;
exports.local = local;
exports.wechat = wechat;
... ...
... ... @@ -50,6 +50,9 @@ router.get('/passport/sms_login/check.json',
smsLogin.check); // only ajax
router.post('/passport/sms_login/password.json', smsLogin.password);
// jsonp获取用户uid
router.get('/passport/login/user', login.user);
// 微信登录
router.get('/passport/login/wechat', login.common.beforeLogin, login.wechat.login);
router.get('/passport/login/wechat/callback', login.wechat.callback);
... ...