加日志
Some checks are pending
Build Docker / build (push) Waiting to run

This commit is contained in:
haomingming 2025-12-22 14:28:02 +08:00
parent 8da16704e6
commit 823d62728d

View File

@ -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;
}
}