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
b96e20de
Commit
b96e20de
authored
Jan 25, 2018
by
clone
Committed by
hujun
Mar 01, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
81421b7e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
12 deletions
+12
-12
AppChat.php
application/chat/controller/AppChat.php
+11
-11
curl_cookie.txt
application/chat/utils/curl_cookie.txt
+1
-1
No files found.
application/chat/controller/AppChat.php
View file @
b96e20de
...
@@ -137,15 +137,15 @@ class AppChat extends Basic
...
@@ -137,15 +137,15 @@ 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' => 'ceshi666',
'msg_content' => 'ceshi666',
'target_type' => 'users',
'target_type' => 'users',
'source' => '1',
'source' => '1',
'from' => 'admin',
'from' => 'admin',
'type' => '1',
'type' => '1',
'is_user' => '0',
'is_user' => '0',
'target' => '18112347151',
'target' => '18112347151',
);*/
);*/
$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其他
...
@@ -206,14 +206,14 @@ class AppChat extends Basic
...
@@ -206,14 +206,14 @@ class AppChat extends Basic
if
(
$file
)
{
if
(
$file
)
{
$path
=
ROOT_PATH
.
'public'
.
DS
.
'static'
.
DS
.
'chat_image'
;
$path
=
ROOT_PATH
.
'public'
.
DS
.
'static'
.
DS
.
'chat_image'
;
$info
=
$file
->
validate
([
'size'
=>
512000
,
'ext'
=>
'jpg,png'
])
//限制500KB
$info
=
$file
->
validate
([
'size'
=>
512000
,
'ext'
=>
'jpg,png'
])
//限制500KB
->
move
(
$path
);
->
move
(
$path
);
if
(
$info
)
{
if
(
$info
)
{
$img_path
=
$info
->
getSaveName
();
//生成的图片路径
$img_path
=
$info
->
getSaveName
();
//生成的图片路径
$static_path
=
$path
.
DS
.
$img_path
;
//生成图片的绝对路径
$static_path
=
$path
.
DS
.
$img_path
;
//生成图片的绝对路径
$image
=
\think\Image
::
open
(
$static_path
);
$image
=
\think\Image
::
open
(
$static_path
);
$image
->
thumb
(
500
,
500
)
->
save
(
$static_path
);
//生成缩略图
$image
->
thumb
(
500
,
500
)
->
save
(
$static_path
);
//生成缩略图
$data
=
[
'file_name'
=>
CHAT_IMG_URL
.
$img_path
];
$data
=
[
'file_name'
=>
CHAT_IMG_URL
.
$img_path
,
'name'
=>
$img_path
];
}
else
{
}
else
{
// 上传失败获取错误信息
// 上传失败获取错误信息
return
$this
->
response
(
"101"
,
$file
->
getError
());
return
$this
->
response
(
"101"
,
$file
->
getError
());
...
...
application/chat/utils/curl_cookie.txt
View file @
b96e20de
...
@@ -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 151686
3904
rememberMe deleteMe
a1.easemob.com FALSE / FALSE 151686
9338
rememberMe deleteMe
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