Browse Source

更新函数

master v1.0.3
wuliangbo 2 years ago
parent
commit
958d36ee96
  1. 10
      src/OpenPlatform/Application.php

10
src/OpenPlatform/Application.php

@ -65,7 +65,8 @@ class Application extends ServiceContainer
string $appId, string $appId,
string $refreshToken = null, string $refreshToken = null,
AccessToken $accessToken = null AccessToken $accessToken = null
): OfficialAccount { ): OfficialAccount
{
$application = new OfficialAccount( $application = new OfficialAccount(
$this->getAuthorizerConfig($appId, $refreshToken), $this->getAuthorizerConfig($appId, $refreshToken),
$this->getReplaceServices($accessToken) + [ $this->getReplaceServices($accessToken) + [
@ -84,7 +85,9 @@ class Application extends ServiceContainer
$socialite->withComponent( $socialite->withComponent(
[ [
'id' => $this['config']['app_id'], 'id' => $this['config']['app_id'],
'token' => fn () => $this['access_token']->getToken()['component_access_token'], 'token' => function () {
return $this['access_token']->getToken()['component_access_token'];
}
] ]
); );
@ -108,7 +111,8 @@ class Application extends ServiceContainer
string $appId, string $appId,
string $refreshToken = null, string $refreshToken = null,
AccessToken $accessToken = null AccessToken $accessToken = null
): MiniProgram { ): MiniProgram
{
return new MiniProgram( return new MiniProgram(
$this->getAuthorizerConfig($appId, $refreshToken), $this->getAuthorizerConfig($appId, $refreshToken),
$this->getReplaceServices($accessToken) + [ $this->getReplaceServices($accessToken) + [

Loading…
Cancel
Save