diff --git a/services/distributeddataservice/service/data_share/data_share_profile_config.cpp b/services/distributeddataservice/service/data_share/data_share_profile_config.cpp index f8fe350040fa7babd603a375b69eca1f9b1cb832..021b27e1dd275b24aa0d3af821ab704a949dd4bd 100644 --- a/services/distributeddataservice/service/data_share/data_share_profile_config.cpp +++ b/services/distributeddataservice/service/data_share/data_share_profile_config.cpp @@ -145,7 +145,11 @@ bool SerialDataShareProxyData::Marshal(json &node) const bool SerialDataShareProxyData::Unmarshal(const json &node) { bool ret = GetValue(node, GET_NAME(uri), uri); - GetValue(node, GET_NAME(value), value); + if (!GetValue(node, GET_NAME(value), value)) { + std::string valueStr; + GetValue(node, GET_NAME(value), valueStr); + value = valueStr; + } GetValue(node, GET_NAME(allowList), allowList); return ret; } diff --git a/services/distributeddataservice/service/data_share/data_share_service_impl.cpp b/services/distributeddataservice/service/data_share/data_share_service_impl.cpp index 4043d0511e7656caf7f1703932713e4689c2e523..64fb1958d8a9bea9787725b0caafefedd632664b 100644 --- a/services/distributeddataservice/service/data_share/data_share_service_impl.cpp +++ b/services/distributeddataservice/service/data_share/data_share_service_impl.cpp @@ -1055,8 +1055,8 @@ std::vector DataShareServiceImpl::GetProxyData(const std::ve ZLOGE("get callerBundleInfo failed"); return result; } - DataShareProxyData proxyData; for (const auto &uri : uris) { + DataShareProxyData proxyData; auto ret = PublishedProxyData::Query(uri, callerBundleInfo, proxyData); result.emplace_back(uri, static_cast(ret), proxyData.value_, proxyData.allowList_); }