提交 ed3be389 编写于 作者: 雪洛's avatar 雪洛

feat: uni.login支持apple登录

上级 8cad60e2
......@@ -18,7 +18,13 @@ const loginByService = (provider, callbackId) => {
code: err.code,
errMsg: 'login:fail:' + err.message
})
})
}, { scope: 'email' })
// apple登录logout之后无法重新触发获取email,fullname
if (provider === 'apple') {
login()
} else {
loginServices[provider].logout(login, login)
}
}
// 先注销再登录
loginServices[provider].logout(login, login)
......@@ -74,6 +80,16 @@ export function getUserInfo (params, callbackId) {
avatarUrl: wechatUserInfo.headimgurl,
unionId: wechatUserInfo.unionid
}
} else if (provider === 'apple') {
const appleInfo = loginService.appleInfo
userInfo = {
openId: appleInfo.user,
fullName: appleInfo.fullName,
email: appleInfo.email,
authorizationCode: appleInfo.authorizationCode,
identityToken: appleInfo.identityToken,
realUserStatus: appleInfo.realUserStatus
}
} else {
loginService.userInfo.openId = loginService.userInfo.openId || loginService.userInfo.openid ||
loginService.authResult.openid
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册