移动千里眼出现错误码11504时,重新发起请求

dev
Jing Li 2023-12-30 23:56:01 +08:00
parent 53c44e8165
commit 96987222aa
1 changed files with 4 additions and 0 deletions

View File

@ -40,6 +40,7 @@ class HttpClient
protected function request(string $method, string $url, array $options = []): array protected function request(string $method, string $url, array $options = []): array
{ {
beginning:
$data = []; $data = [];
if (array_key_exists('json', $options)) { if (array_key_exists('json', $options)) {
$data = $options['json']; $data = $options['json'];
@ -75,6 +76,9 @@ class HttpClient
$resultCode = data_get($result, 'resultCode', '-1'); $resultCode = data_get($result, 'resultCode', '-1');
if ($resultCode === '000000') { if ($resultCode === '000000') {
return $result; return $result;
} elseif ($resultCode === '11504') {
$this->token(true);
goto beginning;
} }
throw new QlyException( throw new QlyException(