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
ff5b8018
Commit
ff5b8018
authored
Jan 20, 2018
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
7043b84a
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
46 additions
and
18 deletions
+46
-18
AppChat.php
application/chat/controller/AppChat.php
+1
-1
ChatService.php
application/chat/service/ChatService.php
+11
-10
RPush.php
application/chat/utils/RPush.php
+3
-1
curl_cookie.txt
application/chat/utils/curl_cookie.txt
+1
-1
AttentionModel.php
application/model/AttentionModel.php
+0
-0
ChatMsg.php
application/model/ChatMsg.php
+1
-1
ChatMsgExt.php
application/model/ChatMsgExt.php
+3
-4
log.txt
log.txt
+26
-0
No files found.
application/chat/controller/AppChat.php
View file @
ff5b8018
...
@@ -117,7 +117,7 @@ class AppChat extends Basic
...
@@ -117,7 +117,7 @@ class AppChat extends Basic
||
!
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(
/*
$params = array(
'msg_content' => '111',
'msg_content' => '111',
'target_type' => 'users',
'target_type' => 'users',
'source' => '1',
'source' => '1',
...
...
application/chat/service/ChatService.php
View file @
ff5b8018
...
@@ -99,7 +99,7 @@ class ChatService
...
@@ -99,7 +99,7 @@ class ChatService
$userResult
=
$this
->
userModel
->
selectUser
(
$userId
);
$userResult
=
$this
->
userModel
->
selectUser
(
$userId
);
if
(
$userResult
->
id
)
if
(
$userResult
->
id
)
$onlyId
=
self
::
SOURCE_TYPE_APP
.
$user
I
d
;
$onlyId
=
self
::
SOURCE_TYPE_APP
.
$user
Result
->
i
d
;
break
;
break
;
}
}
if
(
!
$onlyId
)
{
if
(
!
$onlyId
)
{
...
@@ -143,7 +143,7 @@ class ChatService
...
@@ -143,7 +143,7 @@ class ChatService
$rPush
=
new
RPush
();
$rPush
=
new
RPush
();
//todo 消息接收人必须是数据
//todo 消息接收人必须是数据
$rPush
->
send
(
$target_type
,
[
$target
],
$type
,
$msg_content
,
$from
,
$accessToken
,
[
$this
,
'saveSendStatus'
]);
//
$rPush->send($target_type, [$target], $type, $msg_content, $from, $accessToken, [ $this, 'saveSendStatus' ]);
//返回消息发送成功
//返回消息发送成功
return
true
;
return
true
;
}
}
...
@@ -188,6 +188,7 @@ class ChatService
...
@@ -188,6 +188,7 @@ class ChatService
$msgModel
=
new
ChatMsg
();
$msgModel
=
new
ChatMsg
();
$id
=
$msgModel
->
addChatMsg
(
$params
);
$id
=
$msgModel
->
addChatMsg
(
$params
);
if
(
$id
>
0
)
{
if
(
$id
>
0
)
{
//todo 插入msg_ext
//todo 插入msg_ext
$group_id
=
0
;
$group_id
=
0
;
...
@@ -208,16 +209,16 @@ class ChatService
...
@@ -208,16 +209,16 @@ class ChatService
*/
*/
private
function
insetMsgExt
(
$id
,
$type
,
$msg_content
,
$is_group
,
$group_id
)
private
function
insetMsgExt
(
$id
,
$type
,
$msg_content
,
$is_group
,
$group_id
)
{
{
$param
s
[
"msg_id"
]
=
$id
;
$param
[
"msg_id"
]
=
$id
;
$param
s
[
"type"
]
=
$type
;
$param
[
"type"
]
=
$type
;
$param
s
[
"body"
]
=
$msg_content
;
$param
[
"body"
]
=
$msg_content
;
$param
s
[
"send_type"
]
=
$is_group
;
$param
[
"send_type"
]
=
$is_group
;
$param
s
[
"group_id"
]
=
$group_id
;
$param
[
"group_id"
]
=
$group_id
;
$param
s
[
"create_at"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
$param
[
"create_at"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
$param
s
[
"updated_at"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
$param
[
"updated_at"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
$msgExtModel
=
new
ChatMsgExt
();
$msgExtModel
=
new
ChatMsgExt
();
$msgExtModel
->
addChatMsgExt
(
$param
s
);
$msgExtModel
->
addChatMsgExt
(
$param
);
}
}
/** 获取聊天记录
/** 获取聊天记录
...
...
application/chat/utils/RPush.php
View file @
ff5b8018
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
namespace
app\chat\utils
;
namespace
app\chat\utils
;
use
app\chat\consts\ConfigConst
;
use
app\chat\consts\ConfigConst
;
use
Think\Log
;
/**
/**
...
@@ -53,6 +54,7 @@ class RPush
...
@@ -53,6 +54,7 @@ class RPush
'from'
=>
$from
,
'from'
=>
$from
,
);
);
$data
=
json_encode
(
$arr
);
$data
=
json_encode
(
$arr
);
echo
$data
;
echo
"-------------"
;
$curl
=
new
\app\chat\utils\CurlUtil
();
$curl
=
new
\app\chat\utils\CurlUtil
();
$curl
->
headers
=
[
$curl
->
headers
=
[
"Accept"
=>
"application/json"
,
"Accept"
=>
"application/json"
,
...
@@ -65,7 +67,7 @@ class RPush
...
@@ -65,7 +67,7 @@ class RPush
];
];
$url
=
$this
->
buildSendUrl
();
$url
=
$this
->
buildSendUrl
();
$response
=
$curl
->
post
(
$url
,
$data
);
$response
=
$curl
->
post
(
$url
,
$data
);
dump
(
$response
);
Log
::
record
(
'info -------------'
,
json_encode
(
$response
)
);
return
$response
;
return
$response
;
}
}
...
...
application/chat/utils/curl_cookie.txt
View file @
ff5b8018
...
@@ -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 151641
6547
rememberMe deleteMe
a1.easemob.com FALSE / FALSE 151641
9232
rememberMe deleteMe
application/model/AttentionModel.php
View file @
ff5b8018
application/model/ChatMsg.php
View file @
ff5b8018
...
@@ -29,8 +29,8 @@ class ChatMsg extends Model
...
@@ -29,8 +29,8 @@ class ChatMsg extends Model
try
{
try
{
$this
->
save
(
$params
);
$this
->
save
(
$params
);
$id
=
$this
->
id
;
$id
=
$this
->
id
;
return
$id
;
Db
::
commit
();
Db
::
commit
();
return
$id
;
}
catch
(
\Exception
$e
)
{
}
catch
(
\Exception
$e
)
{
Db
::
rollback
();
Db
::
rollback
();
...
...
application/model/ChatMsgExt.php
View file @
ff5b8018
...
@@ -20,18 +20,17 @@ class ChatMsgExt extends Model
...
@@ -20,18 +20,17 @@ class ChatMsgExt extends Model
public
function
__construct
()
public
function
__construct
()
{
{
$this
->
db
=
Db
(
$this
->
table
);
$this
->
db
=
Db
::
name
(
$this
->
table
);
}
}
public
function
addChatMsgExt
(
$params
)
public
function
addChatMsgExt
(
$params
)
{
{
Db
::
startTrans
();
Db
::
startTrans
();
try
{
try
{
$this
->
save
(
$params
);
$this
->
db
->
insert
(
$params
);
$id
=
$this
->
id
;
return
$id
;
Db
::
commit
();
Db
::
commit
();
}
catch
(
\Exception
$e
)
{
}
catch
(
\Exception
$e
)
{
dump
(
$e
);
Db
::
rollback
();
Db
::
rollback
();
}
}
...
...
log.txt
View file @
ff5b8018
...
@@ -258,3 +258,29 @@ response body = <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
...
@@ -258,3 +258,29 @@ response body = <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<statusMsg>IP鉴权失败</statusMsg>
<statusMsg>IP鉴权失败</statusMsg>
</Response>
</Response>
request body = <TemplateSMS>
<to>18756256666</to>
<appId>8a216da85f5c89b1015f7718e2b90a63</appId>
<templateId>214759</templateId>
<datas><data>3450</data><data>5分钟</data></datas>
</TemplateSMS>
request url = https://app.cloopen.com:8883/2013-12-26/Accounts/8a48b55153eae51101540e763d3b3888/SMS/TemplateSMS?sig=40EE1C43A1B08B698B610DC95026AF74
response body = <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Response>
<statusCode>160053</statusCode>
<statusMsg>IP鉴权失败</statusMsg>
</Response>
request body = <TemplateSMS>
<to>18756255555</to>
<appId>8a216da85f5c89b1015f7718e2b90a63</appId>
<templateId>214759</templateId>
<datas><data>5919</data><data>5分钟</data></datas>
</TemplateSMS>
request url = https://app.cloopen.com:8883/2013-12-26/Accounts/8a48b55153eae51101540e763d3b3888/SMS/TemplateSMS?sig=8DABD7C3A3D79365F4AA65E92613F6A1
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