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

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

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