Compare commits

..

No commits in common. "7690ec848bb5626e664dfded51482d4276fd5e77" and "569b2a84fd2e07d64ebdd0c7e684639da634f99d" have entirely different histories.

View File

@ -293,25 +293,25 @@ class Prescription
// 记录请求日志(隐藏敏感信息) // 记录请求日志(隐藏敏感信息)
$logArg = $arg; $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); $response = $this->client->post($path, $arg);
if ($response->getStatusCode() != '200'){ if ($response->getStatusCode() != '200'){
// 请求失败 // 请求失败
$errorBody = $response->getBody()->getContents(); $errorBody = $response->getBody()->getContents();
Log::getInstance()->error("处方平台HTTP请求失败状态码" . $response->getStatusCode() . ",错误信息:" . $errorBody); // Log::getInstance()->error("处方平台HTTP请求失败状态码" . $response->getStatusCode() . ",错误信息:" . $errorBody);
throw new BusinessException($errorBody); throw new BusinessException($errorBody);
} }
$body = json_decode($response->getBody(),true); $body = json_decode($response->getBody(),true);
if (empty($body)){ if (empty($body)){
// 返回值为空 // 返回值为空
Log::getInstance()->error("处方平台HTTP请求返回值为空路径" . $path); // Log::getInstance()->error("处方平台HTTP请求返回值为空路径" . $path);
throw new BusinessException(HttpEnumCode::getMessage(HttpEnumCode::SERVER_ERROR)); 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; return $body;
} }
} }