|
|
@ -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) + [ |
|
|
@ -155,7 +159,7 @@ class Application extends ServiceContainer |
|
|
|
] |
|
|
|
] |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
return 'https://mp.weixin.qq.com/cgi-bin/componentloginpage?'.http_build_query($queries); |
|
|
|
return 'https://mp.weixin.qq.com/cgi-bin/componentloginpage?' . http_build_query($queries); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -189,7 +193,7 @@ class Application extends ServiceContainer |
|
|
|
] |
|
|
|
] |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
return 'https://mp.weixin.qq.com/safe/bindcomponent?'.http_build_query($queries).'#wechat_redirect'; |
|
|
|
return 'https://mp.weixin.qq.com/safe/bindcomponent?' . http_build_query($queries) . '#wechat_redirect'; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|