Skip to content

微信登录和小程序登录帐号互通 #57

@ChenYilong

Description

@ChenYilong

前微信开放平台,微信公众平台与微信小程序 OAuth 登录会得到三个不同的 openid。微信提供了 unionId 来平台间区分独立用户。

小程序中,unionId 需要从 encryptedData 中解密:

https://mp.weixin.qq.com/debug/wxadoc/dev/api/signature.html

所以在登录时,想保持一致就不能再使用openId了。只能使用unionId

也就是说,下面教程提到的:

https://leancloud.cn/docs/rest_api.html#连接用户账户和第三方平台

{
"第三方平台名称,例如facebook":
{
"uid": "在第三方平台上的唯一用户id字符串",
"access_token": "在第三方平台的 access token",
……其他可选属性
}
}

其中uid部分需要传入unionId。

对应工单:https://leanticket.cn/t/leancloud/3638

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions