| @@ 62-73 (lines=12) @@ | ||
| 59 | * |
|
| 60 | * @return \EntWeChat\Support\Collection |
|
| 61 | */ |
|
| 62 | public function user($code = null) |
|
| 63 | { |
|
| 64 | if ($this->hasInvalidState()) { |
|
| 65 | throw new InvalidStateException(); |
|
| 66 | } |
|
| 67 | ||
| 68 | $params = [ |
|
| 69 | 'code' => $code ?: $this->request->get('code'), |
|
| 70 | ]; |
|
| 71 | ||
| 72 | return $this->parseJSON('get', [self::API_GET_USER_INFO, $params]); |
|
| 73 | } |
|
| 74 | } |
|
| 75 | ||
| @@ 65-76 (lines=12) @@ | ||
| 62 | * |
|
| 63 | * @return \EntWeChat\Support\Collection |
|
| 64 | */ |
|
| 65 | public function user($authCode = null) |
|
| 66 | { |
|
| 67 | if ($this->hasInvalidState()) { |
|
| 68 | throw new InvalidStateException(); |
|
| 69 | } |
|
| 70 | ||
| 71 | $params = [ |
|
| 72 | 'auth_code' => $authCode ?: $this->request->get('auth_code'), |
|
| 73 | ]; |
|
| 74 | ||
| 75 | return $this->parseJSON('json', [self::API_GET_LOGIN_INFO, $params]); |
|
| 76 | } |
|
| 77 | ||
| 78 | /** |
|
| 79 | * {@inheritdoc}. |
|