| @@ 372-386 (lines=15) @@ | ||
| 369 | * |
|
| 370 | * @return array |
|
| 371 | */ |
|
| 372 | protected function getCodeFields($state = null) |
|
| 373 | { |
|
| 374 | $fields = array_merge([ |
|
| 375 | 'client_id' => $this->clientId, |
|
| 376 | 'redirect_uri' => $this->redirectUrl, |
|
| 377 | 'scope' => $this->formatScopes($this->scopes, $this->scopeSeparator), |
|
| 378 | 'response_type' => 'code', |
|
| 379 | ], $this->parameters); |
|
| 380 | ||
| 381 | if ($this->usesState()) { |
|
| 382 | $fields['state'] = $state; |
|
| 383 | } |
|
| 384 | ||
| 385 | return $fields; |
|
| 386 | } |
|
| 387 | ||
| 388 | /** |
|
| 389 | * Format the given scopes. |
|
| @@ 60-74 (lines=15) @@ | ||
| 57 | * |
|
| 58 | * @return array |
|
| 59 | */ |
|
| 60 | public function getCodeFields($state = null) |
|
| 61 | { |
|
| 62 | $fields = [ |
|
| 63 | 'client_key' => $this->clientId, |
|
| 64 | 'redirect_uri' => $this->redirectUrl, |
|
| 65 | 'scope' => $this->formatScopes($this->scopes, $this->scopeSeparator), |
|
| 66 | 'response_type' => 'code', |
|
| 67 | ]; |
|
| 68 | ||
| 69 | if ($this->usesState()) { |
|
| 70 | $fields['state'] = $state; |
|
| 71 | } |
|
| 72 | ||
| 73 | return $fields; |
|
| 74 | } |
|
| 75 | ||
| 76 | /** |
|
| 77 | * 获取access_token地址. |
|