This commit is contained in:
commit
7690ec848b
@ -293,25 +293,25 @@ class Prescription
|
||||
// 记录请求日志(隐藏敏感信息)
|
||||
$logArg = $arg;
|
||||
|
||||
// Log::getInstance()->info("处方平台HTTP请求:" . $path . ",请求参数:" . json_encode($logArg,JSON_UNESCAPED_UNICODE));
|
||||
Log::getInstance()->info("处方平台HTTP请求:" . $path . ",请求参数:" . json_encode($logArg,JSON_UNESCAPED_UNICODE));
|
||||
|
||||
$response = $this->client->post($path, $arg);
|
||||
|
||||
if ($response->getStatusCode() != '200'){
|
||||
// 请求失败
|
||||
$errorBody = $response->getBody()->getContents();
|
||||
// Log::getInstance()->error("处方平台HTTP请求失败,状态码:" . $response->getStatusCode() . ",错误信息:" . $errorBody);
|
||||
Log::getInstance()->error("处方平台HTTP请求失败,状态码:" . $response->getStatusCode() . ",错误信息:" . $errorBody);
|
||||
throw new BusinessException($errorBody);
|
||||
}
|
||||
|
||||
$body = json_decode($response->getBody(),true);
|
||||
if (empty($body)){
|
||||
// 返回值为空
|
||||
// Log::getInstance()->error("处方平台HTTP请求返回值为空,路径:" . $path);
|
||||
Log::getInstance()->error("处方平台HTTP请求返回值为空,路径:" . $path);
|
||||
throw new BusinessException(HttpEnumCode::getMessage(HttpEnumCode::SERVER_ERROR));
|
||||
}
|
||||
|
||||
// Log::getInstance()->info("处方平台HTTP请求成功,路径:" . $path . ",返回数据:" . json_encode($body,JSON_UNESCAPED_UNICODE));
|
||||
Log::getInstance()->info("处方平台HTTP请求成功,路径:" . $path . ",返回数据:" . json_encode($body,JSON_UNESCAPED_UNICODE));
|
||||
return $body;
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user