| 123456789101112131415161718192021222324252627 |
- <?php
- namespace app\extra\dyLife;
- use yzh52521\EasyHttp\Http;
- class Token extends BasicLife
- {
- /**
- * 获取AccessToken
- * https://developer.open-douyin.com/docs/resource/zh-CN/mini-app/develop/server/basic-abilities/interface-request-credential/non-user-authorization/get-client_token
- * @param string $grantType
- * @return array
- */
- public function getAccessToken(string $grantType = 'client_credential'): array
- {
- $data = [
- "client_key" => $this->config['appid'],
- "client_secret" => $this->config['secret'],
- "grant_type" => $grantType
- ];
- return $this->curlPostApi("oauth/client_token/",$data);
- }
- }
|