android 微信 uin,使用uniapp做微信授权登录在安卓端无法获取code怎么办?

使用uniapp做微信授权登录在安卓端无法获取code怎么办?What should I do if I can’t get the code on the Android side using uniapp for WeChat authorized login?使用uniapp做微信授权登录在安卓端无法获取code怎么办?

微信小程序端获取的数据格式与安卓移动应用获取的不一致

微信:

d48e09baaccc4c58a4db5182952c014f.png

安卓移动应用:

305867c950d74de1f389a3e050a0a7e3.png

现在需要把code字段传给后端进行用户判定,这里获取的数据内容无法在数据库搜索到用户,请问如何才可以通过uni.login拿到code字段?

The data format obtained by wechat applet is inconsistent with that obtained by Android mobile app. Wechat: Android mobile app: now it is necessary to pass the code field to the back-end for user judgment. The data content obtained here cannot be searched for users in the database. How can we pass this uni.login Get the code field?

回答:

Mixchain 俞哄哄🤳📲:

你这里都已经拿取到了openid和unionid为啥还要纠结去获取code 判断用户直接通过unionid不就可以了吗

谋谋谋:

app拿不到 只有小程序能拿到 不一致就对了

They Say:

uni.login获取到的code,给后端走接口换取openid,然后用openid去数据库匹配到用户

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值