Exemplo n.º 1
0
 public static function GetAccessToken($corpid, $corpsecret)
 {
     $api = sprintf('%s/gettoken?corpid=%s&corpsecret=%s', WeiXin_Enteprise_Client::$baseURL, $corpid, $corpsecret);
     $tokenInfo = Util_HttpRequest::Get($api);
     if ($tokenInfo) {
         return json_decode($tokenInfo, true);
     }
     return array();
 }
Exemplo n.º 2
0
 public static function GetShorTen($url, $one = true, $source = '5786724301')
 {
     $uTpl = 'https://api.weibo.com/2/short_url/shorten.json?source=%s&url_long=%s';
     $link = sprintf($uTpl, $source, urlencode($url));
     $ret = Util_HttpRequest::Get($link);
     if ($ret) {
         $ret = json_decode($ret, true);
     }
     $urls = array_get($ret, 'urls');
     return $one ? Util_Array::GetFristItem($urls) : $urls;
 }
Exemplo n.º 3
0
 public function get($url, $params = array())
 {
     $url = $this->base_url . $url;
     $j = Util_HttpRequest::Get($url, $params);
     return $this->render($j);
 }