Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
hfpp2012
/
vbot
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 3ff71adf
authored
Jan 22, 2017
by
HanSon
Committed by
GitHub
Jan 22, 2017
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge pull request #22 from HanSon/dev
修改超时设置
2 parents
d023f430
8ecc3db8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
src/Core/MessageHandler.php
src/Core/Sync.php
src/Core/MessageHandler.php
View file @
3ff71ad
...
@@ -130,16 +130,16 @@ class MessageHandler
...
@@ -130,16 +130,16 @@ class MessageHandler
list
(
$retCode
,
$selector
)
=
$this
->
sync
->
checkSync
();
list
(
$retCode
,
$selector
)
=
$this
->
sync
->
checkSync
();
if
(
in_array
(
$retCode
,
[
'1100'
,
'1101'
])){
# 微信客户端上登出或者其他设备登录
if
(
in_array
(
$retCode
,
[
'1100'
,
'1101'
])){
# 微信客户端上登出或者其他设备登录
Console
::
log
(
'[INFO] 微信客户端正常退出'
);
if
(
$this
->
exitHandler
){
if
(
$this
->
exitHandler
){
Console
::
log
(
'[INFO] 微信客户端正常退出'
);
call_user_func_array
(
$this
->
exitHandler
,
[]);
call_user_func_array
(
$this
->
exitHandler
,
[]);
}
}
break
;
break
;
}
elseif
(
$retCode
==
0
){
}
elseif
(
$retCode
==
0
){
$this
->
handlerMessage
(
$selector
);
$this
->
handlerMessage
(
$selector
);
}
else
{
}
else
{
Console
::
log
(
'[INFO] 微信客户端异常退出'
);
if
(
$this
->
exceptionHandler
){
if
(
$this
->
exceptionHandler
){
Console
::
log
(
'[INFO] 微信客户端异常退出'
);
call_user_func_array
(
$this
->
exitHandler
,
[]);
call_user_func_array
(
$this
->
exitHandler
,
[]);
}
}
break
;
break
;
...
...
src/Core/Sync.php
View file @
3ff71ad
...
@@ -32,7 +32,7 @@ class Sync
...
@@ -32,7 +32,7 @@ class Sync
]);
]);
try
{
try
{
$content
=
http
()
->
get
(
$url
);
$content
=
http
()
->
get
(
$url
,
[],
[
'connect_timeout'
=>
60
]
);
preg_match
(
'/window.synccheck=\{retcode:"(\d+)",selector:"(\d+)"\}/'
,
$content
,
$matches
);
preg_match
(
'/window.synccheck=\{retcode:"(\d+)",selector:"(\d+)"\}/'
,
$content
,
$matches
);
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment