Authored by 李奇

第三方登录头像修改

... ... @@ -31,7 +31,7 @@ class expModel extends global.yoho.BaseModel {
});
}
friendHelp({ uid, source, openId, nickname, headIco }) {
friendHelp({ uid, source, openId, nickname, headIcon }) {
return this.get({
data: {
method: 'app.activity.friendhelp',
... ... @@ -39,7 +39,7 @@ class expModel extends global.yoho.BaseModel {
source,
open_id: openId,
nick_name: nickname,
head_ico: headIco
head_ico: headIcon
},
api: global.yoho.API
});
... ...
... ... @@ -9,11 +9,12 @@ const utils = global.yoho.utils;
const AuthHelper = require('../models/auth-helper');
const loginPage = `${config.siteUrl}/signin.html`;
function doPassportCallback(openId, nickname, source, req, res) { // eslint-disable-line
function doPassportCallback(openId, nickname, headIcon, source, req, res) { // eslint-disable-line
if (openId && nickname && source) {
req.session._THIRD_LOGIN_INFO = {
openId,
nickname,
headIcon,
source
};
... ... @@ -154,8 +155,9 @@ const wechat = {
callback: (req, res) => {
const openId = req.query.openId;
const nickname = req.query.nickname;
const headIcon = req.query.headImg;
doPassportCallback(openId, nickname, 'wechat', req, res);
doPassportCallback(openId, nickname, headIcon, 'wechat', req, res);
}
};
... ... @@ -172,8 +174,9 @@ const sina = {
callback: (req, res) => {
const openId = req.query.openId;
const nickname = req.query.nickname;
const headIcon = req.query.headImg;
doPassportCallback(openId, nickname, 'sina', req, res);
doPassportCallback(openId, nickname, headIcon, 'sina', req, res);
}
};
... ... @@ -201,8 +204,9 @@ const qq = {
let nickname = user.nickname;
let openId = user.id;
let headIcon = user._json.figureurl_qq_2 || user._json.figureurl_2;
doPassportCallback(openId, nickname, 'qq', req, res);
doPassportCallback(openId, nickname, headIcon, 'qq', req, res);
})(req, res, next);
} else {
log.error('Auth State Mismatch:' + req.originalUrl);
... ...