国内流行的内容管理系统(CMS)多端全媒体解决方案 https://www.dedebiz.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.7KB

  1. <?php
  2. namespace WeChat;
  3. if (!defined('DEDEINC')) exit('dedebiz');
  4. use WeChat\Contracts\BasicWeChat;
  5. /**
  6. * 接口调用频次限制
  7. * Class Limit
  8. * @package WeChat
  9. */
  10. class Limit extends BasicWeChat
  11. {
  12. /**
  13. * 公众号调用或第三方平台帮公众号调用对公众号的所有api调用(包括第三方帮其调用)次数进行清零
  14. * @return array
  15. * @throws \WeChat\Exceptions\InvalidResponseException
  16. * @throws \WeChat\Exceptions\LocalCacheException
  17. */
  18. public function clearQuota()
  19. {
  20. $url = 'https://api.weixin.qq.com/cgi-bin/clear_quota?access_token=ACCESS_TOKEN';
  21. return $this->callPostApi($url, ['appid' => $this->config->get('appid')]);
  22. }
  23. /**
  24. * 网络检测
  25. * @param string $action 执行的检测动作
  26. * @param string $operator 指定平台从某个运营商进行检测
  27. * @return array
  28. * @throws \WeChat\Exceptions\InvalidResponseException
  29. * @throws \WeChat\Exceptions\LocalCacheException
  30. */
  31. public function ping($action = 'all', $operator = 'DEFAULT')
  32. {
  33. $url = 'https://api.weixin.qq.com/cgi-bin/callback/check?access_token=ACCESS_TOKEN';
  34. return $this->callPostApi($url, ['action' => $action, 'check_operator' => $operator]);
  35. }
  36. /**
  37. * 获取微信服务器IP地址
  38. * @return array
  39. * @throws \WeChat\Exceptions\InvalidResponseException
  40. * @throws \WeChat\Exceptions\LocalCacheException
  41. */
  42. public function getCallbackIp()
  43. {
  44. $url = 'https://api.weixin.qq.com/cgi-bin/getcallbackip?access_token=ACCESS_TOKEN';
  45. $this->registerApi($url, __FUNCTION__, func_get_args());
  46. return $this->httpGetForJson($url);
  47. }
  48. }
  49. ?>