Commit 604428fe by HanSon

测试好友获取

1 parent d5b7e805
......@@ -9,6 +9,7 @@
namespace Hanson\Vbot\Collections;
use Hanson\Vbot\Support\Console;
use Hanson\Vbot\Support\FileManager;
class ContactFactory
......@@ -48,13 +49,15 @@ class ContactFactory
/**
* 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) {
if(official()->isOfficial($contact['VerifyFlag'])){ #公众号
......@@ -67,6 +70,11 @@ class ContactFactory
contact()->put($contact['UserName'], $contact);
}
}
if($seq != 0){
Console::log('seq: ' . $seq);
$this->makeContactList($seq);
}
}
/**
......
......@@ -178,8 +178,8 @@ class Server
$this->redirectUri = $matches[1] . '&fun=new';
$domainList = [
'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'],
'qq.com' => ['file.wx.qq.com', 'webpush.wx.qq.com'],
'web2.wechat.com' => ['file.web2.wechat.com', 'webpushweb2.wechat.com'],
'wechat.com' => ['file.web.wechat.com', 'webpushweb.web.wechat.com'],
];
......@@ -191,11 +191,13 @@ class Server
$this->baseUri = sprintf($url, $domain);
$this->domain = $domain;
break;
}else{
$this->fileUri = $this->pushUri = $this->redirectUri;
}
}
return;
case '408':
Console::log('登录超时,请重试', Console::ERROR);
Console::log('登录超时,请重试', Console::WARNING);
$tip = 1;
$retryTime -= 1;
sleep(1);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!