Commit bfaf74df by HanSon Committed by GitHub

Merge pull request #48 from HanSon/test-friend

好友数量修复
2 parents 4026f3d0 09bbfbb4
...@@ -152,6 +152,16 @@ $robot->server->run(); ...@@ -152,6 +152,16 @@ $robot->server->run();
[liuwons/wxBot](https://github.com/liuwons/wxBot) 参考了整个微信的登录流程与消息处理 [liuwons/wxBot](https://github.com/liuwons/wxBot) 参考了整个微信的登录流程与消息处理
## 贡献者
排名不分先后,时间排序
[zhuanxuhit](https://github.com/zhuanxuhit) terminal显示二维码
[littlecodersh](https://github.com/littlecodersh) 分次加载好友数量方案
[yuanshi2016](https://github.com/yuanshi2016) 分次加载好友数量方案、登录域名方案以及测试
## 问题和建议 ## 问题和建议
有问题或者建议都可以提issue 有问题或者建议都可以提issue
......
...@@ -10,9 +10,7 @@ ...@@ -10,9 +10,7 @@
], ],
"require": { "require": {
"guzzlehttp/guzzle": "^6.2", "guzzlehttp/guzzle": "^6.2",
"symfony/dom-crawler": "2.8.*|3.0.*|3.1.*",
"endroid/qrcode": "^1.7", "endroid/qrcode": "^1.7",
"symfony/css-selector": "2.8.*|3.0.*|3.1.*",
"pimple/pimple": "^3.0", "pimple/pimple": "^3.0",
"illuminate/support": "^5.3", "illuminate/support": "^5.3",
"nesbot/carbon": "^1.21", "nesbot/carbon": "^1.21",
......
...@@ -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,10 @@ class ContactFactory ...@@ -67,6 +70,10 @@ class ContactFactory
contact()->put($contact['UserName'], $contact); contact()->put($contact['UserName'], $contact);
} }
} }
if($seq != 0){
$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'],
'wx.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!