作者 郭文星

111

... ... @@ -98,8 +98,10 @@ class Index extends Api
$appid = 'wxb7dd0c03865a94e0';//公众号的appid
$secret = '6af75a6fb8211da45631630e34769f82';
// 获取token
$token=$this->getAccToken($appid,$secret);
$myurl = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=" . $appid . "&secret=" . $secret;
$json_token = http_request($myurl);
$access_tokens = json_decode($json_token, true);
$token = $access_tokens['access_token'];
//$url = "https://api.weixin.qq.com/cgi-bin/message/wxopen/template/uniform_send?access_token=".$token;
$url = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=".$token;
... ...