| @@ 81-89 (lines=9) @@ | ||
| 78 | * |
|
| 79 | * @return \Overtrue\Socialite\AccessToken |
|
| 80 | */ |
|
| 81 | public function getAccessToken($code = '') |
|
| 82 | { |
|
| 83 | $response = $this->getHttpClient()->post($this->getTokenUrl(), [ |
|
| 84 | 'headers' => ['Content-Type' => 'application/json'], |
|
| 85 | 'json' => $this->getTokenFields($code), |
|
| 86 | ]); |
|
| 87 | ||
| 88 | return $this->parseAccessToken($response->getBody()->getContents()); |
|
| 89 | } |
|
| 90 | ||
| 91 | /** |
|
| 92 | * 获取 app_access_token 接口参数. |
|
| @@ 95-103 (lines=9) @@ | ||
| 92 | /** |
|
| 93 | * {@inheritdoc}. |
|
| 94 | */ |
|
| 95 | public function getAccessToken($code) |
|
| 96 | { |
|
| 97 | $response = $this->getHttpClient()->get($this->getTokenUrl(), [ |
|
| 98 | 'headers' => ['Accept' => 'application/json'], |
|
| 99 | 'query' => $this->getTokenFields($code), |
|
| 100 | ]); |
|
| 101 | ||
| 102 | return $this->parseAccessToken($response->getBody()); |
|
| 103 | } |
|
| 104 | ||
| 105 | /** |
|
| 106 | * {@inheritdoc}. |
|