private function getAccessToken(){
$appId = $this->appId;
$appSecret = $this->appSecret;
$url = 'https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid='.$appId.'&secret='.$appSecret;
$res = $this->api_request($url);
if(isset($res->access_token)){
return array(
'errcode' =>0,
'errmsg' =>'success',
'access_token' =>$res->access_token,
'expires_in' =>$res->expires_in
);
}else{
return array(
'errcode' =>$res->errcode,
'errmsg' =>$res->errmsg,
'access_token' =>null,
'expires_in' =>null
);
}
}
JSSDK.zip ( 3.1 KB 下载:26 次 )
AD:真正免费,域名+虚机+企业邮箱=0元