This commit is contained in:
aozhiwei 2019-07-29 14:01:01 +08:00
parent 4e637d7646
commit 555a47941e

View File

@ -370,7 +370,7 @@ class KefuController {
} }
} }
function https_request($url, $data = null) function httpsRequest($url, $data = null)
{ {
$curl = curl_init(); $curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl, CURLOPT_URL, $url);
@ -395,7 +395,7 @@ class KefuController {
); );
$access_token = $this->getAccessToken($gameid); $access_token = $this->getAccessToken($gameid);
$url = "https://api.weixin.qq.com/cgi-bin/media/upload?access_token=$access_token&type=$type"; $url = "https://api.weixin.qq.com/cgi-bin/media/upload?access_token=$access_token&type=$type";
$res_str = $this->https_request($url, $filedata); $res_str = $this->httpsRequest($url, $filedata);
$res = json_decode($res_str, true); $res = json_decode($res_str, true);
if(isset($res['media_id'])) { if(isset($res['media_id'])) {
return $res['media_id']; return $res['media_id'];