提交 0672ab8d 编写于 作者: DCloud_JSON's avatar DCloud_JSON

更新 注册/登录后:userInfo仅返回inviteCode,nickname,username,_id

上级 b7dbac6a
...@@ -325,6 +325,10 @@ exports.main = async (event, context) => { ...@@ -325,6 +325,10 @@ exports.main = async (event, context) => {
nickname, nickname,
inviteCode inviteCode
}); });
if(typeof(res.userInfo) == 'object'){
const {inviteCode,nickname,username,_id} = res.userInfo;
res.userInfo = {inviteCode,nickname,username,_id};
}
if (res.code === 0) { if (res.code === 0) {
await registerSuccess(res) await registerSuccess(res)
} }
...@@ -355,7 +359,10 @@ exports.main = async (event, context) => { ...@@ -355,7 +359,10 @@ exports.main = async (event, context) => {
await uniIdLog(res); await uniIdLog(res);
needCaptcha = await isNeedCaptcha(); needCaptcha = await isNeedCaptcha();
} }
if(typeof(res.userInfo) == 'object'){
const {inviteCode,nickname,username,_id} = res.userInfo;
res.userInfo = {inviteCode,nickname,username,_id};
}
res.needCaptcha = needCaptcha; res.needCaptcha = needCaptcha;
break; break;
case 'loginByWeixin': case 'loginByWeixin':
...@@ -635,6 +642,7 @@ exports.main = async (event, context) => { ...@@ -635,6 +642,7 @@ exports.main = async (event, context) => {
} = await uniID.getUserInfo({ } = await uniID.getUserInfo({
uid: params.uid uid: params.uid
}) })
console.error('getUserInfo',userInfo);
if (userInfo.role.indexOf('admin') === -1) { if (userInfo.role.indexOf('admin') === -1) {
res = { res = {
code: 403, code: 403,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册