This commit is contained in:
2020-11-17 10:44:29 +08:00
parent ec99186fe2
commit d7827c424c
3 changed files with 188 additions and 56 deletions
+1 -6
View File
@@ -17,16 +17,11 @@ class HttpClient extends Component
{
/**
* @param $name
* @return IClient
*/
public static function NewRequest(): IClient
{
if (Coroutine::getCid() > 0) {
return Client::NewRequest();
} else {
return Curl::NewRequest();
}
return Coroutine::getCid() > 0 ? Client::NewRequest() : Curl::NewRequest();
}