Browse Source

更新函数

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

14
src/OpenPlatform/Application.php

@ -65,7 +65,8 @@ class Application extends ServiceContainer @@ -65,7 +65,8 @@ class Application extends ServiceContainer
string $appId,
string $refreshToken = null,
AccessToken $accessToken = null
): OfficialAccount {
): OfficialAccount
{
$application = new OfficialAccount(
$this->getAuthorizerConfig($appId, $refreshToken),
$this->getReplaceServices($accessToken) + [
@ -84,7 +85,9 @@ class Application extends ServiceContainer @@ -84,7 +85,9 @@ class Application extends ServiceContainer
$socialite->withComponent(
[
'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 @@ -108,7 +111,8 @@ class Application extends ServiceContainer
string $appId,
string $refreshToken = null,
AccessToken $accessToken = null
): MiniProgram {
): MiniProgram
{
return new MiniProgram(
$this->getAuthorizerConfig($appId, $refreshToken),
$this->getReplaceServices($accessToken) + [
@ -155,7 +159,7 @@ class Application extends ServiceContainer @@ -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 @@ -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';
}
/**

Loading…
Cancel
Save