diff --git a/uni_modules/uni-id-cf/uniCloud/cloudfunctions/uni-id-cf/index.js b/uni_modules/uni-id-cf/uniCloud/cloudfunctions/uni-id-cf/index.js index 393afb2bc0c6beca1c4dba1767416173d7a05115..7d649e9fe065654cabaaa70da36a3730363fab7e 100644 --- a/uni_modules/uni-id-cf/uniCloud/cloudfunctions/uni-id-cf/index.js +++ b/uni_modules/uni-id-cf/uniCloud/cloudfunctions/uni-id-cf/index.js @@ -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,