Commit 604428fe by HanSon

测试好友获取

1 parent d5b7e805
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
namespace Hanson\Vbot\Collections; namespace Hanson\Vbot\Collections;
use Hanson\Vbot\Support\Console;
use Hanson\Vbot\Support\FileManager; use Hanson\Vbot\Support\FileManager;
class ContactFactory class ContactFactory
...@@ -48,13 +49,15 @@ class ContactFactory ...@@ -48,13 +49,15 @@ class ContactFactory
/** /**
* make instance model * make instance model
* * @param int $seq
*/ */
public function makeContactList() public function makeContactList($seq = 0)
{ {
$url = sprintf(server()->baseUri . '/webwxgetcontact?pass_ticket=%s&skey=%s&r=%s', server()->passTicket, server()->skey, time()); $url = sprintf(server()->baseUri . '/webwxgetcontact?pass_ticket=%s&skey=%s&r=%s&seq=%s', server()->passTicket, server()->skey, time(), $seq);
$memberList = http()->json($url, [], true)['MemberList']; $result = http()->json($url, [], true);
$memberList = $result['MemberList'];
$seq = $result['Seq'];
foreach ($memberList as $contact) { foreach ($memberList as $contact) {
if(official()->isOfficial($contact['VerifyFlag'])){ #公众号 if(official()->isOfficial($contact['VerifyFlag'])){ #公众号
...@@ -67,6 +70,11 @@ class ContactFactory ...@@ -67,6 +70,11 @@ class ContactFactory
contact()->put($contact['UserName'], $contact); contact()->put($contact['UserName'], $contact);
} }
} }
if($seq != 0){
Console::log('seq: ' . $seq);
$this->makeContactList($seq);
}
} }
/** /**
......
...@@ -178,8 +178,8 @@ class Server ...@@ -178,8 +178,8 @@ class Server
$this->redirectUri = $matches[1] . '&fun=new'; $this->redirectUri = $matches[1] . '&fun=new';
$domainList = [ $domainList = [
'wx2.qq.com' => ['file.wx2.qq.com', 'webpush.wx2.qq.com'], 'wx2.qq.com' => ['file.wx2.qq.com', 'webpush.wx2.qq.com'],
'wx.qq.com' => ['file.wx.qq.com', 'webpush.wx.qq.com'],
'wx8.qq.com' => ['file.wx8.qq.com', 'webpush.wx8.qq.com'], 'wx8.qq.com' => ['file.wx8.qq.com', 'webpush.wx8.qq.com'],
'qq.com' => ['file.wx.qq.com', 'webpush.wx.qq.com'],
'web2.wechat.com' => ['file.web2.wechat.com', 'webpushweb2.wechat.com'], 'web2.wechat.com' => ['file.web2.wechat.com', 'webpushweb2.wechat.com'],
'wechat.com' => ['file.web.wechat.com', 'webpushweb.web.wechat.com'], 'wechat.com' => ['file.web.wechat.com', 'webpushweb.web.wechat.com'],
]; ];
...@@ -191,11 +191,13 @@ class Server ...@@ -191,11 +191,13 @@ class Server
$this->baseUri = sprintf($url, $domain); $this->baseUri = sprintf($url, $domain);
$this->domain = $domain; $this->domain = $domain;
break; break;
}else{
$this->fileUri = $this->pushUri = $this->redirectUri;
} }
} }
return; return;
case '408': case '408':
Console::log('登录超时,请重试', Console::ERROR); Console::log('登录超时,请重试', Console::WARNING);
$tip = 1; $tip = 1;
$retryTime -= 1; $retryTime -= 1;
sleep(1); sleep(1);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!