Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.3.17 版本获取 token 的问题 #1022

Closed
cmzz opened this issue Nov 13, 2017 · 2 comments
Closed

3.3.17 版本获取 token 的问题 #1022

cmzz opened this issue Nov 13, 2017 · 2 comments

Comments

@cmzz
Copy link

cmzz commented Nov 13, 2017

我用的环境

PHP 版本:7.1
overtrue/wechat 版本:3.3.17
是否使用了框架?框架名称:laravel

问题及现象

升级到3.3.17 后, 或去 OpenPlatform 的 AccessToken 有问题。

tinker 里面的模拟操作:

>>> $r = $http->json($url, $data);
=> GuzzleHttp\Psr7\Response {#1323}
>>> $http->parseJson($r);
=> false
>>> $http->parseJson($r->getBody());
=> [
     "component_access_token" => "5kpwbzZ54kqj78OtNFP_e1UAGq2cAymI7SKwskry9jG9Oohgp30fQgeExxT5h7oIXyEhY7sC9KknNvWp2VqH7EMnoU0ahpwYLgApUBMKq7Rr_tGEH_gg0meOm281BYIlOJJgAHAKFF",
     "expires_in" => 7200,
   ]
>>> $http->parseJson($r->getBody()->getContents());
=> false
>>> $r->getBody()->getContents();
=> ""   

原因是 $r->getBody()->getContents() 返回为空

@mingyoung
Copy link
Collaborator

更新到 3.3.20 即可

@cmzz
Copy link
Author

cmzz commented Nov 13, 2017

好的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants