0 1392

如题这个错误是获取微信的token值出的错,检查发现appid和appsecret都对,那什么还会报这个错。

原来要获取微信的token必须要在微信后台加上IP白名单才行



$url = 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid='.$this->appid.'&secret='.$this->appsecret;
$datajson = file_get_contents($url);
$data = json_decode($datajson,true);
if(!empty($data['access_token'])){
    $this->ci->common_model->updatetable('config', array('value'=>$data['access_token']), array('key'=>'access_token'));
    return $data['access_token'];
}


[分类]
[来源] http://erlangyun.com/p/id/177.html
[声明] 本站资源来自用户分享,如损害你的权益请联系客服QQ:120074275给予处理。