feat: App联合登录新增unionId

master
学习很差啦 2023-03-10 09:09:32 +08:00
parent d870ee409a
commit a77390bf5c
1 changed files with 5 additions and 1 deletions

View File

@ -428,6 +428,7 @@
// //
uni.setStorageSync("nickname", infoRes.userInfo.nickName); uni.setStorageSync("nickname", infoRes.userInfo.nickName);
uni.setStorageSync("avatar", infoRes.userInfo.avatarUrl); uni.setStorageSync("avatar", infoRes.userInfo.avatarUrl);
uni.setStorageSync("unionId", infoRes.userInfo.unionId);
// #ifdef MP-WEIXIN // #ifdef MP-WEIXIN
//openid openiduni-id: https://uniapp.dcloud.net.cn/uniCloud/uni-id //openid openiduni-id: https://uniapp.dcloud.net.cn/uniCloud/uni-id
@ -454,8 +455,11 @@
nickname: uni.getStorageSync("nickname"), // nickname: uni.getStorageSync("nickname"), //
avatar: uni.getStorageSync("avatar"), // avatar: uni.getStorageSync("avatar"), //
uniAccessToken: uni.getStorageSync("uni_access_token"), //token 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) => { openIdLogin(params, clientType).then((res) => {
if (!res.data.success) { if (!res.data.success) {
let errormessage = "第三方登录暂不可用"; let errormessage = "第三方登录暂不可用";