...
|
...
|
@@ -25,6 +25,7 @@ const loginPage = `${config.siteUrl}/signin.html`; |
|
|
function doPassportCallback(openId, nickname, sourceType, req, res) {
|
|
|
let shoppingKey = cookie.getShoppingKey(req);
|
|
|
let refer = req.cookies.refer;
|
|
|
let from = req.cookies.from || 'yohobuy';
|
|
|
|
|
|
if (refer) {
|
|
|
refer = decodeURI(req.cookies.refer);
|
...
|
...
|
@@ -39,7 +40,9 @@ function doPassportCallback(openId, nickname, sourceType, req, res) { |
|
|
refer = utils.refererLimit(refer);
|
|
|
|
|
|
if (openId && nickname) {
|
|
|
return req.ctx(AuthHelperModel).signinByOpenID(nickname, openId, sourceType, shoppingKey).then((result) => {
|
|
|
return req.ctx(AuthHelperModel).signinByOpenID({
|
|
|
nickname, openId, sourceType, shoppingKey, from
|
|
|
}).then((result) => {
|
|
|
if (result.code !== 200) {
|
|
|
return Promise.reject(result);
|
|
|
}
|
...
|
...
|
|