Commit 1e72c73a authored by clone's avatar clone

bug

parent ccab486e
...@@ -110,13 +110,22 @@ class AppChat extends Basic ...@@ -110,13 +110,22 @@ class AppChat extends Basic
*/ */
public function pushMsg() public function pushMsg()
{ {
$params = $this->params; $params = $this->params;
if (!isset($params['target_type']) || !isset($params['target']) || !isset($params['type']) || !isset($params['msg_content']) if (!isset($params['target_type']) || !isset($params['target']) || !isset($params['type']) || !isset($params['msg_content'])
|| !isset($params['source']) || !isset($params['is_user']) || !isset($params['from'])) { || !isset($params['source']) || !isset($params['is_user']) || !isset($params['from'])) {
return $this->response(ErrorCodeConst::ERROR_CODE_PARAM_NOT_EXIST, "请求参数错误"); return $this->response(ErrorCodeConst::ERROR_CODE_PARAM_NOT_EXIST, "请求参数错误");
} }
/* $params = array (
'msg_content' => '看看',
'target_type' => 'users',
'source' => '1',
'from' => 'app_63',
'type' => '1',
'is_user' => '0',
'target' => 'app_64',
);*/
$target_type = $params['target_type']; // 消息类型 users 给用户发消息。chatgroups: 给群发消息,chatrooms: 给聊天室发消息 $target_type = $params['target_type']; // 消息类型 users 给用户发消息。chatgroups: 给群发消息,chatrooms: 给聊天室发消息
$target = $params['target']; //接受人 if target_type 群 者表示群id $target = $params['target']; //接受人 if target_type 群 者表示群id
$source = $params['source']; //消息来源 1c端app 2b端app 3其他 $source = $params['source']; //消息来源 1c端app 2b端app 3其他
......
...@@ -137,7 +137,7 @@ class ChatService ...@@ -137,7 +137,7 @@ class ChatService
*/ */
public function sendMsg($target_type, $target, $source, $is_user, $type, $msg_content, $from, $accessToken) public function sendMsg($target_type, $target, $source, $is_user, $type, $msg_content, $from, $accessToken)
{ {
//todo //todo
$this->insertMsg($target_type, $target, $source, $is_user, $type, $msg_content, $from); $this->insertMsg($target_type, $target, $source, $is_user, $type, $msg_content, $from);
$rPush = new RPush(); $rPush = new RPush();
...@@ -157,10 +157,10 @@ class ChatService ...@@ -157,10 +157,10 @@ class ChatService
*/ */
public function saveSendStatus($response, $target, $sender, $msg_content) public function saveSendStatus($response, $target, $sender, $msg_content)
{ {
$response = json_decode($response, true); /* $response = json_decode($response, true);
$response['time'] = date('Y-m-d H:i:s'); $response['time'] = date('Y-m-d H:i:s');
$status = $response['statusCode'] == RPush::PUSH_STATUS_SUCCESS ? MsgStatus::STATUS_SUCCESS : MsgStatus::STATUS_FAILURE; $status = $response['statusCode'] == RPush::PUSH_STATUS_SUCCESS ? MsgStatus::STATUS_SUCCESS : MsgStatus::STATUS_FAILURE;
$this->insertPushLog($sender, $target, $msg_content, $status, $response['statusMsg']); $this->insertPushLog($sender, $target, $msg_content, $status, $response['statusMsg']);*/
} }
/** /**
......
...@@ -58,7 +58,7 @@ class RPush ...@@ -58,7 +58,7 @@ class RPush
$curl->headers = [ $curl->headers = [
"Accept" => "application/json", "Accept" => "application/json",
"Content-Type" => "application/json;charset=utf-8", "Content-Type" => "application/json;charset=utf-8",
'Authorization' => $access_token, 'Authorization' => "Bearer " .$access_token,
]; ];
$curl->options = [ $curl->options = [
"CURLOPT_SSL_VERIFYPEER" => 0, "CURLOPT_SSL_VERIFYPEER" => 0,
......
...@@ -2,4 +2,4 @@ ...@@ -2,4 +2,4 @@
# http://curl.haxx.se/docs/http-cookies.html # http://curl.haxx.se/docs/http-cookies.html
# This file was generated by libcurl! Edit at your own risk. # This file was generated by libcurl! Edit at your own risk.
a1.easemob.com FALSE / FALSE 1516352505 rememberMe deleteMe a1.easemob.com FALSE / FALSE 1516356233 rememberMe deleteMe
...@@ -141,7 +141,7 @@ Route::group('api', [ ...@@ -141,7 +141,7 @@ Route::group('api', [
Route::group('chat', [ Route::group('chat', [
'index' => [ 'chat/AppChat/index', [ 'method' => 'get' ] ], 'index' => [ 'chat/AppChat/index', [ 'method' => 'get' ] ],
'userChat' => [ 'chat/AppChat/userChat', [ 'method' => 'post|get' ] ], 'userChat' => [ 'chat/AppChat/userChat', [ 'method' => 'post|get' ] ],
'sendMsg' => [ 'chat/AppChat/sendMsg', [ 'method' => 'post|get' ] ], 'pushMsg' => [ 'chat/AppChat/pushMsg', [ 'method' => 'post|get' ] ],
]); ]);
Route::group('task',[ Route::group('task',[
......
...@@ -245,3 +245,16 @@ response body = <?xml version="1.0" encoding="UTF-8" standalone="yes"?> ...@@ -245,3 +245,16 @@ response body = <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<statusMsg>IP鉴权失败</statusMsg> <statusMsg>IP鉴权失败</statusMsg>
</Response> </Response>
request body = <TemplateSMS>
<to>15038133185</to>
<appId>8a216da85f5c89b1015f7718e2b90a63</appId>
<templateId>214759</templateId>
<datas><data>1323</data><data>5分钟</data></datas>
</TemplateSMS>
request url = https://app.cloopen.com:8883/2013-12-26/Accounts/8a48b55153eae51101540e763d3b3888/SMS/TemplateSMS?sig=A83C2D00731E2A9F65F7CAC298B44B09
response body = <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Response>
<statusCode>160053</statusCode>
<statusMsg>IP鉴权失败</statusMsg>
</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