新增了字段返回
Build Docker / build (push) Has been cancelled

This commit is contained in:
2025-09-04 13:01:00 +08:00
parent b72110fd2a
commit bde4ef5a0f
4 changed files with 32 additions and 2 deletions
+20
View File
@@ -35,4 +35,24 @@ class HttpRequest
return json_decode($response->getBody(),true);
}
/**
* 请求封装
* post请求
* @param string $path
* @param array $option
* @return array
* @throws GuzzleException
*/
public function getRequest(string $path, array $option = []): array
{
$response = $this->client->get($path, $option);
if ($response->getStatusCode() != '200'){
// 请求失败
throw new BusinessException(HttpEnumCode::SERVER_ERROR,$response->getBody()->getContents());
}
return json_decode($response->getBody(),true);
}
}