使用MiniprogramThirdpartyPlugin.openAuthorizeAccount方法跳转到用户授权页,没有列出用户数据。
打开时有一个cloud-function报错
触发代码如下
const MiniprogramThirdpartyPlugin = requirePlugin(
"miniprogram-thirdparty-plugin"
);
// 初始化
MiniprogramThirdpartyPlugin.init(wx);
const res = request(xxx) // 向后端获取pre_auth_code
const { pre_auth_code } = res.data;
// 请求用户授权
MiniprogramThirdpartyPlugin.openAuthorizeAccount({
platformAppID: "wxa62506f206fea415", // 第三方代开发平台appid
preAuthCode: pre_auth_code, //获取的预授权码
authType: 2,
// bizAppid: "wxxxxxxxxx", //非必填字段,指定授权唯一的小程序或公众号
});