{"errcode":48001,"errmsg":"api unauthorized, rid: 64749e9e-6e10c911-0ccf22d0"}
场景:
- 用户通过第三方平台代授权小程序,获取了小程序openid
- 用户通过第三方平台待授权公众号,出现了48001
查询rid,提示授权失败
POST https://api.weixin.qq.com/cgi-bin/openapi/rid/get?access_token=token69_fv_K2onSb7wzQJdVwhELZJb4FiglvIvEulP1ZLpLgjOciFhaBw4m7Bd6nC4OK07WTq1N6oYCtJcUBjRAe4SxCtHnSJa3klckcSxI_VjkJRx9nAsaEIkNOPuCBe8FBSdAFAXTK&rid=6474b662-6f815bdb-44836ec3
https://developers.weixin.qq.com/doc/oplatform/Third-party_Platforms/2.0/api/Before_Develop/Official_Accounts/official_account_website_authorization.html
折腾了一天,才发现,用easywechat组件,调用的方式不正确:
// 获取 OAuth 授权结果用户信息 // $user = $officialAccount->oauth->userFromCode($request->get('code'))->getRaw(); $user = $officialAccount->oauth->tokenFromCode($request->get('code'));