Skip to content

Commit

Permalink
SocialiteOpenWork传入base_uri设置参数 (#2607)
Browse files Browse the repository at this point in the history
* fix: SocialiteOpenWork传入base_uri设置参数

* fix: fix-style
  • Loading branch information
wjfz authored Oct 14, 2022
1 parent 5489ef8 commit 46d01b3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
10 changes: 6 additions & 4 deletions src/OpenWork/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -315,10 +315,11 @@ public function getOAuth(
): SocialiteProviderInterface {
$suiteAccessToken = $suiteAccessToken ?? $this->getSuiteAccessToken();

return (new OpenWeWork([
return (new OpenWeWork(array_filter([
'client_id' => $suiteId,
'redirect_url' => $this->config->get('oauth.redirect_url'),
]))->withSuiteTicket($this->getSuiteTicket()->getTicket())
'base_url' => $this->config->get('http.base_uri'),
])))->withSuiteTicket($this->getSuiteTicket()->getTicket())
->withSuiteAccessToken($suiteAccessToken->getToken())
->scopes((array) $this->config->get('oauth.scopes', ['snsapi_base']));
}
Expand All @@ -329,10 +330,11 @@ public function getCorpOAuth(
): SocialiteProviderInterface {
$suiteAccessToken = $suiteAccessToken ?? $this->getSuiteAccessToken();

return (new OpenWeWork([
return (new OpenWeWork(array_filter([
'client_id' => $corpId,
'redirect_url' => $this->config->get('oauth.redirect_url'),
]))->withSuiteTicket($this->getSuiteTicket()->getTicket())
'base_url' => $this->config->get('http.base_uri'),
])))->withSuiteTicket($this->getSuiteTicket()->getTicket())
->withSuiteAccessToken($suiteAccessToken->getToken())
->scopes((array) $this->config->get('oauth.scopes', ['snsapi_base']));
}
Expand Down
3 changes: 1 addition & 2 deletions src/Pay/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,8 @@ public function request(string $method, string $url, array $options = []): Respo
$options['headers'] = array_merge($this->prependHeaders, $options['headers'] ?? []);
}


return new Response(
$this->client->request($method, $url, $options),
$this->client->request($method, $url, $options),
failureJudge: $this->isV3Request($url) ? null : fn (Response $response) => $response->toArray()['result_code'] === 'FAIL' || $response->toArray()['return_code'] === 'FAIL',
throw: $this->throw
);
Expand Down

1 comment on commit 46d01b3

@vercel
Copy link

@vercel vercel bot commented on 46d01b3 Oct 14, 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.