eee
This commit is contained in:
+3
-3
@@ -56,10 +56,10 @@ class Result
|
||||
*/
|
||||
public static function init(Client $client): static
|
||||
{
|
||||
if (!in_array($client->getStatusCode(), [101, 200, 201])) {
|
||||
return new Result(code: 505, message: $client->getBody());
|
||||
if (!in_array($client->statusCode, [101, 200, 201])) {
|
||||
return new Result(code: 505, message: $client->body);
|
||||
}
|
||||
$body = json_decode($client->getBody(), true);
|
||||
$body = json_decode($client->body, true);
|
||||
if (isset($body['errcode']) && $body['errcode'] != 0) {
|
||||
return new Result(code: $body['errcode'], message: $body['errmsg']);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user