diff --git a/app/api/controller/User.php b/app/api/controller/User.php index 72cd04a3..95e14b05 100755 --- a/app/api/controller/User.php +++ b/app/api/controller/User.php @@ -60,7 +60,6 @@ class User extends Api $userAuth = Db::name('user_auth')->where('user_id', $this->user_id)->find(); if($userAuth) { $postData = [ - 'access_token' => $response['access_token'], 'content' => $post['value'], 'version' => 2, 'scene' => 1, @@ -69,10 +68,13 @@ class User extends Api $ch = curl_init(); // 初始化curl - curl_setopt($ch, CURLOPT_URL, 'https://api.weixin.qq.com/wxa/msg_sec_check'); // 抓取指定网页 + curl_setopt($ch, CURLOPT_URL, 'https://api.weixin.qq.com/wxa/msg_sec_check?access_token=' . $response['access_token']); // 抓取指定网页 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // 要求结果为字符串并输出到屏幕上 curl_setopt($ch, CURLOPT_POST, 1); // post请求方式 curl_setopt($ch, CURLOPT_POSTFIELDS, $postData); // post变量 + curl_setopt($ch, CURLOPT_HTTPHEADER, array( + 'Content-Type: application/json', + )); $output = curl_exec($ch); curl_close($ch);