|
|
|
@ -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();
|
|
|
|
|
}
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|