From a77390bf5cdce50102df7127c0331d0e789b0911 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=E4=B9=A0=E5=BE=88=E5=B7=AE=E5=95=A6?= <17633066053@163.com> Date: Fri, 10 Mar 2023 09:09:32 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20App=E8=81=94=E5=90=88=E7=99=BB=E5=BD=95?= =?UTF-8?q?=E6=96=B0=E5=A2=9EunionId?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/passport/login.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pages/passport/login.vue b/pages/passport/login.vue index 0d5a5d1..859be67 100644 --- a/pages/passport/login.vue +++ b/pages/passport/login.vue @@ -428,6 +428,7 @@ //写入用户信息 uni.setStorageSync("nickname", infoRes.userInfo.nickName); uni.setStorageSync("avatar", infoRes.userInfo.avatarUrl); + uni.setStorageSync("unionId", infoRes.userInfo.unionId); // #ifdef MP-WEIXIN //微信小程序获取openid 需要特殊处理 如需获取openid请参考uni-id: https://uniapp.dcloud.net.cn/uniCloud/uni-id @@ -454,8 +455,11 @@ nickname: uni.getStorageSync("nickname"), // 昵称 avatar: uni.getStorageSync("avatar"), // 头像 uniAccessToken: uni.getStorageSync("uni_access_token"), //第三方token + type:this.clientType, + token:{unionId:""} }; - uni.getStorageSync("unionId") && (params.unionId = uni.getStorageSync("unionId")); + uni.getStorageSync("unionId") ? (params.token.unionId = uni.getStorageSync("unionId")) : delete params.token; + openIdLogin(params, clientType).then((res) => { if (!res.data.success) { let errormessage = "第三方登录暂不可用";