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

小程序 文章 2020-08-12 20:01 3421 0 全屏看文

AI助手支持GPT4.0

使用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怎么办?

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

微信:

安卓移动应用:

现在需要把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去数据库匹配到用户

-EOF-

AI助手支持GPT4.0