用公众号平台操作服务号的网页授权,$user->getRaw()结果不一致 #2815
Unanswered
yangwenqian
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
$op=new \EasyWeChat\OpenPlatform\Application($config);
$account=$op->getOfficialAccountWithRefreshToken($appid, $refresh_token);
$oauth=$account->getOAuth();
$user=$oauth->scopes(['snsapi_'.$sns_type])->userFromCode(Request::input('code'))->getRaw();
当$sns_type=='base',返回结果为[],空数组
当$sns_type=='userinfo',返回结果正常
删除->getRaw()之后,
当$sns_type=='base',返回结果正常,不是原始数据
当$sns_type=='userinfo',结果虽然正常,不是原始数据
当前解决办法是:
session(['user' => $sns_type == 'base' ? $user->toArray() : $user->getRaw()]);
getRaw接口输出结果不应该一致吗?
Beta Was this translation helpful? Give feedback.
All reactions