add clear

This commit is contained in:
2020-04-03 17:12:03 +08:00
parent 92d7ba8ff5
commit 2c2fe5d5a1
3 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -48,7 +48,7 @@ class Container
} }
/** /**
* @param \common\Config $config * @param wchat\common\Config $config
* @return $this * @return $this
*/ */
public function generate(Config $config) public function generate(Config $config)
+1 -1
View File
@@ -278,7 +278,7 @@ class HttpClient
private function request($url, $data = []) private function request($url, $data = [])
{ {
$data = $this->paramEncode($data); $data = $this->paramEncode($data);
if ($this->use_swoole && $this->isCli()) { if ($this->use_swoole || $this->isCli()) {
[$url, $host] = $this->parseUrlHost($url); [$url, $host] = $this->parseUrlHost($url);
return $this->coroutine($host, $url, $data); return $this->coroutine($host, $url, $data);
} else { } else {
+4 -4
View File
@@ -73,9 +73,6 @@ abstract class Miniprogarampage implements Progaram
*/ */
public function __construct() public function __construct()
{ {
$this->request = HttpClient::NewRequest();
$this->request->setIsSSL(true);
$this->request->setData(null);
} }
/** /**
@@ -106,6 +103,9 @@ abstract class Miniprogarampage implements Progaram
public function initConfig($config) public function initConfig($config)
{ {
$this->config = $config; $this->config = $config;
$this->request = HttpClient::NewRequest();
$this->request->setIsSSL(true);
$this->request->setData(null);
$this->request->setUseSwoole($config->isUsrSwoole()); $this->request->setUseSwoole($config->isUsrSwoole());
$this->request->setAgent($config->getAgent()); $this->request->setAgent($config->getAgent());
if (!empty($config->getSslCert())) { if (!empty($config->getSslCert())) {
@@ -118,7 +118,7 @@ abstract class Miniprogarampage implements Progaram
} }
/** /**
* @return \common\Config * @return \wchat\common\Config
*/ */
public function getConfig() public function getConfig()
{ {