Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujun
tl_estate
Commits
1e72c73a
Commit
1e72c73a
authored
Jan 19, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
ccab486e
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
29 additions
and
7 deletions
+29
-7
AppChat.php
application/chat/controller/AppChat.php
+10
-1
ChatService.php
application/chat/service/ChatService.php
+3
-3
RPush.php
application/chat/utils/RPush.php
+1
-1
curl_cookie.txt
application/chat/utils/curl_cookie.txt
+1
-1
route.php
application/route.php
+1
-1
log.txt
log.txt
+13
-0
No files found.
application/chat/controller/AppChat.php
View file @
1e72c73a
...
@@ -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其他
...
...
application/chat/service/ChatService.php
View file @
1e72c73a
...
@@ -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']);
*/
}
}
/**
/**
...
...
application/chat/utils/RPush.php
View file @
1e72c73a
...
@@ -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
,
...
...
application/chat/utils/curl_cookie.txt
View file @
1e72c73a
...
@@ -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 151635
2505
rememberMe deleteMe
a1.easemob.com FALSE / FALSE 151635
6233
rememberMe deleteMe
application/route.php
View file @
1e72c73a
...
@@ -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/send
Msg'
,
[
'method'
=>
'post|get'
]
],
'
pushMsg'
=>
[
'chat/AppChat/push
Msg'
,
[
'method'
=>
'post|get'
]
],
]);
]);
Route
::
group
(
'task'
,[
Route
::
group
(
'task'
,[
...
...
log.txt
View file @
1e72c73a
...
@@ -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>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment