...
|
...
|
@@ -211,42 +211,36 @@ const index = (params) => { |
|
|
});
|
|
|
};
|
|
|
|
|
|
const _detailInfo = (uid) => {
|
|
|
return api.get('', {
|
|
|
method: 'app.passport.profile',
|
|
|
uid: uid
|
|
|
}, {
|
|
|
code: 200
|
|
|
});
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* 个人基本资料
|
|
|
* @param params
|
|
|
*/
|
|
|
const myDetails = (uid) => {
|
|
|
if (uid) {
|
|
|
return api.get('', {
|
|
|
method: 'app.passport.profile',
|
|
|
uid: uid
|
|
|
}, {
|
|
|
code: 200
|
|
|
}).then((result) => {
|
|
|
|
|
|
if (result.data) {
|
|
|
result.data.gender = (result.data.gender === '1' ? '男' : '女');
|
|
|
result.data.qrcodeLink = helpers.urlFormat('/home/user/qrcode', {
|
|
|
token: _.get(result, 'data.uid', null) ?
|
|
|
return api.all([_detailInfo(uid), _getCode(uid)]).then(result => {
|
|
|
if (result[0].data) {
|
|
|
result[0].data.gender = (result[0].data.gender === '1' ? '男' : '女');
|
|
|
result[0].data.qrcodeLink = helpers.urlFormat('/home/user/qrcode', {
|
|
|
token: _.get(result[0], 'data.uid', null) ?
|
|
|
crypto.encryption('yoho9646yoho9646', _.get(result, 'data.uid', null) + '') : '',
|
|
|
icon: _.get(result, 'data.head_ico', ''),
|
|
|
uname: _.get(result, 'data.nickname', ''),
|
|
|
vip: _.get(result, 'data.vip_info.cur_level')
|
|
|
icon: _.get(result[0], 'data.head_ico', ''),
|
|
|
uname: _.get(result[0], 'data.nickname', ''),
|
|
|
vip: _.get(result[0], 'data.vip_info.cur_level')
|
|
|
});
|
|
|
return result.data;
|
|
|
|
|
|
// {
|
|
|
// nickname: result.data.nickname,
|
|
|
// gender: result.data.gender,
|
|
|
// birthday: result.data.birthday,
|
|
|
// headIco: result.data.headIco,
|
|
|
// vipInfo: {
|
|
|
// curLevel: result.data.vipInfo.curLevel
|
|
|
// }
|
|
|
// }
|
|
|
result[0].data.trendWorld = _.get(result[1].data, 'trendWorld', false);
|
|
|
result[0].data.inviteCode = _.get(result[1].data, 'inviteCode', false);
|
|
|
}
|
|
|
|
|
|
// return finalResult;
|
|
|
return result[0].data;
|
|
|
});
|
|
|
} else {
|
|
|
return Promise.resolve({});
|
...
|
...
|
|