Commit a3ef3a50 authored by hj's avatar hj

更新提交

parent 17a15f80
...@@ -24,7 +24,7 @@ class ChemSrcApiService extends PlatformAbstractService ...@@ -24,7 +24,7 @@ class ChemSrcApiService extends PlatformAbstractService
try { try {
if ($this->checkPlatformStatus()) { if ($this->checkPlatformStatus()) {
$cas = urlencode(urlencode(iconv("gbk", "UTF-8", $cas))); $cas = urlencode(urlencode(iconv("gbk", "UTF-8", $cas)));
return $this->clientRequest('get', $this->platformInfo['platform_url'] . '/searchResult/'.$cas.'/', []); return $this->clientRequest('get', $this->platformInfo['platform_url'] . '/searchResult/'.$cas.'/', [], false);
} }
}catch(\Exception $e){ }catch(\Exception $e){
$this->requestError($e); $this->requestError($e);
......
...@@ -77,7 +77,7 @@ trait HttpClientHelpers ...@@ -77,7 +77,7 @@ trait HttpClientHelpers
return $this->clientRequest('post', $uri, $options); return $this->clientRequest('post', $uri, $options);
} }
public function clientRequest($requestType, $uri,$options) public function clientRequest($requestType, $uri,$options, $writeLog = true)
{ {
$requestOptions = $this->getDefaultOptions(); $requestOptions = $this->getDefaultOptions();
$requestOptions = array_merge_recursive($requestOptions, $options); $requestOptions = array_merge_recursive($requestOptions, $options);
...@@ -96,7 +96,9 @@ trait HttpClientHelpers ...@@ -96,7 +96,9 @@ trait HttpClientHelpers
$response = $client->request($requestType,$uri,$requestOptions); $response = $client->request($requestType,$uri,$requestOptions);
$responseContent = $response->getBody()->getContents(); $responseContent = $response->getBody()->getContents();
if($writeLog){
SimpleLogs::writeLog($responseContent, 'api_response'); SimpleLogs::writeLog($responseContent, 'api_response');
}
return $responseContent; return $responseContent;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment