Commit a3ef3a50 authored by hj's avatar hj

更新提交

parent 17a15f80
......@@ -24,7 +24,7 @@ class ChemSrcApiService extends PlatformAbstractService
try {
if ($this->checkPlatformStatus()) {
$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){
$this->requestError($e);
......
......@@ -77,7 +77,7 @@ trait HttpClientHelpers
return $this->clientRequest('post', $uri, $options);
}
public function clientRequest($requestType, $uri,$options)
public function clientRequest($requestType, $uri,$options, $writeLog = true)
{
$requestOptions = $this->getDefaultOptions();
$requestOptions = array_merge_recursive($requestOptions, $options);
......@@ -96,7 +96,9 @@ trait HttpClientHelpers
$response = $client->request($requestType,$uri,$requestOptions);
$responseContent = $response->getBody()->getContents();
SimpleLogs::writeLog($responseContent, 'api_response');
if($writeLog){
SimpleLogs::writeLog($responseContent, 'api_response');
}
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