Authored by htoooth

Merge branch 'feature/user-session' into feature/format

... ... @@ -61,7 +61,7 @@ exports.saveComment = (req, res, next) => {
// get post args
let data = {
uid: req.user.uid,
uid: req.user.uid.toString(),
productSkn: req.body.productSkn,
productId: req.body.productId,
content: req.body.content,
... ...
... ... @@ -66,7 +66,19 @@ function doPassportCallback(req, res, user) {
refer: refer
});
} else if (result.data['is_bind'] === 'Y' && result.data.uid) {//eslint-disable-line
return loginService.syncUserSession(result.data.uid, req, res, result.data.session_key).then(() => {
let uid = {
toString() {
return this.uid;
},
uid: result.data.uid,
sessionKey: result.data.session_key,
isValid() {
return this.uid && this.sessionKey;
}
};
return loginService.syncUserSession(uid, req, res, result.data.session_key).then(() => {
return refer;
});
}
... ... @@ -118,6 +130,10 @@ const local = {
domain: config.cookieDomain
});
res.clearCookie('_SESSION_KEY', {
domain: config.cookieDomain
});
let bindMobile = _.trim(req.query.bindMobile || '');
let bindArea = '+' + _.trim(req.query.bindArea || '86');
let areaArr = PassportHelper.getCountry();
... ...