AccessToken.php 980 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /**
  3. * 重庆赤晓店信息科技有限公司
  4. * https://www.chixiaodian.com
  5. * Copyright (c) 2023 赤店商城 All rights reserved.
  6. */
  7. namespace ByteDance\MiniProgram\Auth;
  8. use ByteDance\Kernel\AccessToken as BaseAccessToken;
  9. /**
  10. * Class AuthorizerAccessToken.
  11. *
  12. * @author overtrue <i@overtrue.me>
  13. */
  14. class AccessToken extends BaseAccessToken
  15. {
  16. /**
  17. * @var string
  18. */
  19. protected $endpointToGetToken = 'https://developer.toutiao.com/api/apps/token';
  20. /**
  21. * @return array
  22. */
  23. protected function getCredentials(): array
  24. {
  25. $client_secret = $this->app['config']['app_secret'];
  26. date_default_timezone_set('Asia/Shanghai');
  27. $client_id = $this->app['config']['app_id'];
  28. $grand_type = 'client_credential';
  29. return [
  30. 'grant_type' => $grand_type,
  31. 'appid' => $client_id,
  32. 'secret' => $client_secret,
  33. ];
  34. }
  35. }