From 0672ab8d30d5db5168fef99bb93fcd382118125e Mon Sep 17 00:00:00 2001 From: linju Date: Mon, 6 Nov 2023 15:06:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20=E6=B3=A8=E5=86=8C/?= =?UTF-8?q?=E7=99=BB=E5=BD=95=E5=90=8E=EF=BC=9AuserInfo=E4=BB=85=E8=BF=94?= =?UTF-8?q?=E5=9B=9EinviteCode,nickname,username,=5Fid?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../uniCloud/cloudfunctions/uni-id-cf/index.js | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) 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 393afb2..7d649e9 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, -- GitLab