Esempio n. 1
0
 /**
  *
  * 通过code从工作平台获取openid机器access_token
  * @param string $code 微信跳转回来带上的code
  *
  * @return openid
  */
 public function GetOpenidFromMp($code)
 {
     $url = $this->__CreateOauthUrlForOpenid($code);
     pt_log($url);
     $curl = new PtCurl();
     $res = $curl->get($url);
     pt_log($res['body']);
     $data = json_decode($res['body'], true);
     $this->data = $data;
     $openid = $data['openid'];
     //echo $openid;
     return $openid;
 }
Esempio n. 2
0
 function curl_get($url)
 {
     $curl = new Curl();
     $res = $curl->get($url);
 }