Skip to content

Commit

Permalink
hotfix: suiteTicket 使用缺省值 fixed #2542
Browse files Browse the repository at this point in the history
  • Loading branch information
overtrue committed Jul 18, 2022
1 parent 8d33fdc commit 5aeb35b
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/OpenWork/SuiteAccessToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,14 @@ class SuiteAccessToken implements RefreshableAccessTokenInterface
public function __construct(
protected string $suiteId,
protected string $suiteSecret,
protected SuiteTicketInterface $suiteTicket,
protected ?SuiteTicketInterface $suiteTicket = null,
protected ?string $key = null,
?CacheInterface $cache = null,
?HttpClientInterface $httpClient = null,
) {
$this->httpClient = $httpClient ?? HttpClient::create(['base_uri' => 'https://qyapi.weixin.qq.com/']);
$this->cache = $cache ?? new Psr16Cache(new FilesystemAdapter(namespace: 'easywechat', defaultLifetime: 1500));
$this->suiteTicket ??= new SuiteTicket($this->suiteId, $this->cache);
}

public function getKey(): string
Expand Down Expand Up @@ -98,7 +99,7 @@ public function refresh(): string
'json' => [
'suite_id' => $this->suiteId,
'suite_secret' => $this->suiteSecret,
'suite_ticket' => $this->suiteTicket->getTicket(),
'suite_ticket' => $this->suiteTicket?->getTicket(),
],
])->toArray(false);

Expand Down

1 comment on commit 5aeb35b

@vercel
Copy link

@vercel vercel bot commented on 5aeb35b Jul 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

easywechat – ./

easywechat-git-6x-overtrue.vercel.app
easywechat-overtrue.vercel.app
easywechat.vercel.app

Please sign in to comment.