diff --git a/composer.json b/composer.json index edaadba0ae18624b0bf89c686f1ce2fdbcd82d6f..098022add16f6450f9de925d1c26ac1ad9a9e623 100644 --- a/composer.json +++ b/composer.json @@ -22,7 +22,6 @@ "ext-json": "*", "ext-curl": "*", "topthink/framework": "^6.0.0", - "liguangchun/curl": "^1.0", "liguangchun/think-library": "6.x-dev" }, "autoload": { diff --git a/src/Api.php b/src/Api.php index 4dc8b40c7bef67fc606ee6206298b911e06408e6..3c325adf3a1bbec99434e88004a5ec08e5807d7b 100644 --- a/src/Api.php +++ b/src/Api.php @@ -16,7 +16,7 @@ namespace DtApp\Think\Bt; -use DtApp\Curl\CurlException; +use DtApp\ThinkLibrary\exception\CurlException; /** * 接口 diff --git a/src/BaseBt.php b/src/BaseBt.php index adf0bf350a038f167905eb4c27c9049629936886..ac4cc0e19442ecfd0e56fbcf7e953bd570ef6285 100644 --- a/src/BaseBt.php +++ b/src/BaseBt.php @@ -16,8 +16,8 @@ namespace DtApp\Think\Bt; -use DtApp\Curl\BtCn; -use DtApp\Curl\CurlException; +use DtApp\ThinkLibrary\exception\CurlException; +use DtApp\ThinkLibrary\service\curl\BtService; /** * 中间件 @@ -72,8 +72,13 @@ class BaseBt $fp = fopen($cookie_file, 'w+'); fclose($fp); } - $BtCn = new BtCn($config); - return $BtCn->httpPost($url, $data, $cookie_file, 60, $is_json); + return BtService::instance() + ->panel($this->config->get('panel')) + ->key($this->config->get('key')) + ->url($url) + ->cookie($cookie_file) + ->data($data) + ->toArray($is_json); } /**