云打包apk后直接安装到手机可以正常使用Google登陆,但云打包aab后上架到Google play安装后可以唤起Google登陆但是选择后没有正常回调,没有触发后续操作。vue版本vue3
7***@qq.com
- 发布:2023-09-18 21:11
- 更新:2023-12-06 12:02
- 阅读:498
7***@qq.com (作者)
export const login = (provider: 'google' | 'facebook' | 'apple' | 'weixin' | any) => {
return new Promise((resolve, reject) => {
console.log(provider)
uni.login({
'provider': provider,
success: () => {
uni.getUserInfo({
provider,
success: (info: {[key:string]: any}) => {
resolve(info)
},
fail:(err: any) => {
reject(err)
}
})
},
error: (error: any) => {
reject(error)
console.log(error)
uni.hideLoading()
}
})
})
}
async google () {
uni.showLoading({title: '', mask: true})
let res = await login('google')
if (res.errMsg !== 'getUserInfo:ok') return
const {app: {config: {globalProperties}}} = createApp()
let resp = await globalProperties.$api.POST_LOGIN({sourceType: 1, userInfo: res.userInfo, platform: 1})
globalProperties.$store.setSync('token', resp.token)
globalProperties.$store.setSync('userId', resp.userId)
globalProperties.$store.setSync('nickname', resp.nickname)
uni.hideLoading()
setTimeout(() => {
this.$emit('loginSuccess')
})
this.close()
}
7***@qq.com (作者)
代码在下方,apk和aab版本的app录屏上传不上来
2023-09-20 10:06
7***@qq.com (作者)
apk包和aab包录屏已经上传
2023-09-20 13:48