fix rt data

This commit is contained in:
lnk
2025-02-18 17:10:22 +08:00
parent a110614220
commit 183685b017
3 changed files with 114 additions and 9 deletions

View File

@@ -726,7 +726,7 @@ std::string extractDataJson(const char* inputJson) {
if (messageJson == NULL || messageJson->type != cJSON_String) {
std::cerr << "'messageJson' is missing or is not an cJSON_String" << std::endl;
cJSON_Delete(root);
return false;
return "";
}
// <20><><EFBFBD><EFBFBD> messageBody <20>е<EFBFBD> JSON <20>ַ<EFBFBD><D6B7><EFBFBD>
@@ -734,14 +734,14 @@ std::string extractDataJson(const char* inputJson) {
if (messageBodyStr == nullptr || strlen(messageBodyStr) == 0) {
std::cerr << "Failed to parse 'messageBody' JSON or it's empty." << std::endl;
cJSON_Delete(root);
return false;
return "";
}
cJSON* messageBody = cJSON_Parse(messageBodyStr); // <20><><EFBFBD><EFBFBD> messageBody <20>ַ<EFBFBD><D6B7><EFBFBD>
if (messageBody == NULL) {
std::cerr << "Failed to parse 'messageBody' JSON." << std::endl;
cJSON_Delete(root);
return false;
return "";
}
// <20><>ȡ "data" <20><><EFBFBD><EFBFBD>