We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
PHP 版本: overtrue/wechat 版本:3.3.2
看下面
\EasyWeChat\Foundation\ServiceProviders\OpenPlatformServiceProvider
// OAuth for OpenPlatform. $pimple['open_platform.oauth'] = function ($pimple) { $callback = $this->prepareCallbackUrl($pimple); $scopes = $pimple['config']->get('open_platform.oauth.scopes', []); $socialite = (new Socialite([ 'wechat_open' => [ 'client_id' => $pimple['open_platform.authorizer']->getAppId(), 'client_secret' => [ $pimple['open_platform.access_token']->getAppId(), // 这里过早的获取 token $pimple['open_platform.access_token']->getToken(), ], 'redirect' => $callback, ], ]))->driver('wechat_open'); if (!empty($scopes)) { $socialite->scopes($scopes); } return $socialite; };
如此 $openPlatorm->createAuthorizerApplication() 时就会触发获取 token,无论是否使用 oauth。 缓存无效的情况下,明显减慢应用的初始化,而且如果 token 过期后,在使用 oauth 就会报错了吧。
$openPlatorm->createAuthorizerApplication()
直接这样可行否?
'client_secret' =>$pimple['open_platform.access_token']
等实际用上的时候在获取。
The text was updated successfully, but these errors were encountered:
的确存在这个问题
Sorry, something went wrong.
Fix (#702)
11bbd56
* update socialite version. * Fix #701
No branches or pull requests
我用的环境
PHP 版本:
overtrue/wechat 版本:3.3.2
问题及现象
看下面
\EasyWeChat\Foundation\ServiceProviders\OpenPlatformServiceProvider
如此
$openPlatorm->createAuthorizerApplication()
时就会触发获取 token,无论是否使用 oauth。缓存无效的情况下,明显减慢应用的初始化,而且如果 token 过期后,在使用 oauth 就会报错了吧。
直接这样可行否?
等实际用上的时候在获取。
The text was updated successfully, but these errors were encountered: