Skip to content

Commit 80e1d2b

Browse files
committed
接口有变动,需要将 access_token 放入 header 中发送
https://developer.github.com/changes/2020-02-10-deprecating-auth-through-query-param/
1 parent fa4381d commit 80e1d2b

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/GithubApi.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,23 +52,19 @@ class GithubApi
5252
private static $client;
5353

5454
/**
55-
* 请求参数
55+
* 初始化
5656
*
57-
* @var array
57+
* @param array $config
5858
*/
59-
private static $options = [];
60-
6159
public static function init ($config = [])
6260
{
63-
static::$options = [
61+
static::$client = new \GuzzleHttp\Client([
6462
'verify' => false,
6563
'base_uri' => static::BASE_URL,
6664
'headers' => [
6765
'Content-Type' => 'application/json'
6866
]
69-
];
70-
71-
static::$client = new \GuzzleHttp\Client(static::$options);
67+
]);
7268

7369
if(isset($config['access_token']))
7470
{

0 commit comments

Comments
 (0)