| @@ 149-162 (lines=14) @@ | ||
| 146 | * |
|
| 147 | * @return bool|array |
|
| 148 | */ |
|
| 149 | public function refresh($refreshToken) |
|
| 150 | { |
|
| 151 | $queryStr = [ |
|
| 152 | 'appid' => $this->getAppId(), |
|
| 153 | 'grant_type' => 'refresh_token', |
|
| 154 | 'refresh_token' => $refreshToken, |
|
| 155 | ]; |
|
| 156 | ||
| 157 | $this->apitype = 'sns'; |
|
| 158 | $this->module = 'oauth2'; |
|
| 159 | $res = $this->_get('refresh_token', $queryStr); |
|
| 160 | ||
| 161 | return $res; |
|
| 162 | } |
|
| 163 | ||
| 164 | /** |
|
| 165 | * 获取access token |
|
| @@ 171-185 (lines=15) @@ | ||
| 168 | * |
|
| 169 | * @return string |
|
| 170 | */ |
|
| 171 | public function getAccessPermission($code) |
|
| 172 | { |
|
| 173 | $queryStr = [ |
|
| 174 | 'appid' => $this->getAppId(), |
|
| 175 | 'secret' => $this->getAppSecret(), |
|
| 176 | 'code' => $code, |
|
| 177 | 'grant_type' => 'authorization_code', |
|
| 178 | ]; |
|
| 179 | ||
| 180 | $this->apitype = 'sns'; |
|
| 181 | $this->module = 'oauth2'; |
|
| 182 | $res = $this->_get('access_token', $queryStr); |
|
| 183 | ||
| 184 | return $res; |
|
| 185 | } |
|
| 186 | } |
|
| 187 | ||