作者 郭文星

121

@@ -108,7 +108,7 @@ class Index extends Api @@ -108,7 +108,7 @@ class Index extends Api
108 108
109 // 构造要发送的消息数据 109 // 构造要发送的消息数据
110 $data = [ 110 $data = [
111 - 'touser' => $unionId, 111 + 'touser' => $openId,
112 'msgtype' => 'text', 112 'msgtype' => 'text',
113 'text' => [ 113 'text' => [
114 'content' => '你好,这是一个公众号消息' 114 'content' => '你好,这是一个公众号消息'
@@ -129,7 +129,6 @@ class Index extends Api @@ -129,7 +129,6 @@ class Index extends Api
129 129
130 // 处理响应结果 130 // 处理响应结果
131 $result = json_decode($response, true); 131 $result = json_decode($response, true);
132 - print_r($result);return;  
133 if ($result['errcode'] == 0) { 132 if ($result['errcode'] == 0) {
134 echo "消息发送成功"; 133 echo "消息发送成功";
135 } else { 134 } else {