diff --git a/app/Iot/Qly/HttpClient.php b/app/Iot/Qly/HttpClient.php index 5fde51b..6925755 100644 --- a/app/Iot/Qly/HttpClient.php +++ b/app/Iot/Qly/HttpClient.php @@ -40,6 +40,7 @@ class HttpClient protected function request(string $method, string $url, array $options = []): array { + beginning: $data = []; if (array_key_exists('json', $options)) { $data = $options['json']; @@ -75,6 +76,9 @@ class HttpClient $resultCode = data_get($result, 'resultCode', '-1'); if ($resultCode === '000000') { return $result; + } elseif ($resultCode === '11504') { + $this->token(true); + goto beginning; } throw new QlyException(