From 9bf45ae0d33bbb4fbfb92c09a03d6877241c8dd9 Mon Sep 17 00:00:00 2001 From: ELF <360197197@qq.com> Date: Thu, 26 Dec 2019 21:26:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controller/ConsoleController.class.php | 40 +++++++++++++++++++ .../Home/Controller/HomeController.class.php | 2 +- 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/Application/Admin/Controller/ConsoleController.class.php b/Application/Admin/Controller/ConsoleController.class.php index 602063e05..3fd04ec0b 100644 --- a/Application/Admin/Controller/ConsoleController.class.php +++ b/Application/Admin/Controller/ConsoleController.class.php @@ -7,6 +7,7 @@ use Admin\Model\SpendModel; use Think\Think; use Base\Tool\Printer; use Base\Service\PromoteService; +use GuzzleHttp\Client; class ConsoleController extends Think { @@ -263,4 +264,43 @@ class ConsoleController extends Think { } } } + + public function testLogin() + { + /* $client = new Client([ + 'base_uri' => 'http://47.111.118.107:9501', + 'timeout' => 10.0, + ]); + $response = $client->post('/game-event/login', [ + 'form_params' => [ + 'user_id' => 28747, + 'game_id' => 153, + 'login_time' => 1577361998 + ] + ]); + $result = (string)$response->getBody(); + echo $result; */ + + $data = [ + 'user_id' => 28747, + 'game_id' => 153, + 'login_time' => 1577361998 + ]; + $client = new Client([ + 'base_uri' => 'http://47.111.118.107:9501', + 'timeout' => 5.0, + ]); + $promise = $client->requestAsync('POST', '/game-event/login', [ + 'form_params' => $data + ]); + $promise->then( + function (ResponseInterface $res) { + echo $res->getStatusCode() . PHP_EOL; + }, + function (RequestException $e) { + echo $e->getMessage() . PHP_EOL; + echo $e->getRequest()->getMethod(); + } + ); + } } diff --git a/Application/Home/Controller/HomeController.class.php b/Application/Home/Controller/HomeController.class.php index adc53ef6a..0c8145339 100644 --- a/Application/Home/Controller/HomeController.class.php +++ b/Application/Home/Controller/HomeController.class.php @@ -227,7 +227,7 @@ class HomeController extends Controller } // 调试 - $isIOS = true; + // $isIOS = true; $downloadUrl = ''; if (!$isNewIos && $isIOS13) {