Commit f8e419bd authored by clone's avatar clone Committed by hujun

bug

parent d749dd8e
...@@ -28,7 +28,7 @@ class RPush ...@@ -28,7 +28,7 @@ class RPush
{ {
//todo 这里做算法优化,环信接口有限制,每个时间段最多能推送多少请求 //todo 这里做算法优化,环信接口有限制,每个时间段最多能推送多少请求
$response = $this->sendRequestByCurl($target_type, $target, $type, $msg_content, $from, $access_token); $response = $this->sendRequestByCurl($target_type, $target, $msg_content, $from, $access_token);
call_user_func_array([ $callback[0], $callback[1] ], [ $response, $target, $from, $msg_content ]); call_user_func_array([ $callback[0], $callback[1] ], [ $response, $target, $from, $msg_content ]);
...@@ -44,12 +44,12 @@ class RPush ...@@ -44,12 +44,12 @@ class RPush
* @param $access_token * @param $access_token
* @return \app\chat\utils\CurlResponse|bool * @return \app\chat\utils\CurlResponse|bool
*/ */
public function sendRequestByCurl($target_type, $target, $type, $msg_content, $from ,$access_token) public function sendRequestByCurl($target_type, $target, $msg_content, $from ,$access_token)
{ {
$arr = array( $arr = array(
'target_type' => $target_type, 'target_type' => $target_type,
'target' => $target, 'target' => $target,
'msg' => [ "type" => $type, "msg" => $msg_content ], 'msg' => [ "type" => "txt", "msg" => $msg_content ],
'from' => $from, 'from' => $from,
); );
$data = json_encode($arr); $data = json_encode($arr);
...@@ -65,6 +65,7 @@ class RPush ...@@ -65,6 +65,7 @@ class RPush
]; ];
$url = $this->buildSendUrl(); $url = $this->buildSendUrl();
$response = $curl->post($url, $data); $response = $curl->post($url, $data);
dump($response);
return $response; return $response;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment