示例#1
0
文件: Weibo.php 项目: xswolf/baihey
 public function getTokenByCode($code)
 {
     $this->accessTokenUrl .= "client_id={$this->appKey}&client_secret={$this->appSecret}&grant_type=authorization_code&code={$code}&redirect_uri={$this->callbackUrl}";
     return (array) json_decode(Curl::getInstance()->curl_post($this->accessTokenUrl, []));
 }
示例#2
0
文件: WeChat.php 项目: xswolf/baihey
 /**
  * 获取素材列表
  * @throws \yii\web\HttpException
  */
 public function materialList()
 {
     $url = self::MATERIAL_LIST . $this->getAccessToken();
     $param['type'] = 'news';
     $param['offset'] = 0;
     $param['count'] = 20;
     $paramJson = json_encode($param);
     $result = Curl::getInstance()->curl_post($url, $paramJson);
     $result = json_decode($result);
     //        var_dump($result);
     return $result;
 }