feat: Add if decrypt failed logic.

This commit is contained in:
sunwen
2025-03-21 14:24:18 +08:00
parent 2ed7ab751b
commit ed7a1206a1

View File

@@ -91,7 +91,11 @@ PatientData PatientDataReader::getPatientDataFromHJ(const std::string& aFilePath
char* patientCString = new char[aConfigHeader->getPatientLength()];
stream.read(patientCString,aConfigHeader->getPatientLength());
std::string patientJsonString = patientCString;
patientJsonString = AESEncryptHelper::decrypt(patientJsonString);
patientJsonString = AESEncryptHelper::decrypt(patientJsonString);
if(patientJsonString.empty())
{
return result;
}
nlohmann::json jsonObj = nlohmann::json::parse(patientJsonString);
if(!jsonObj.contains("Patient Info"))
{