From 78c15ab75d3bcbf57bfae216d1dc51b8e49886ce Mon Sep 17 00:00:00 2001 From: Cuiziyuan Date: Wed, 2 Jul 2025 16:15:59 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9D=99=E6=80=81=E9=85=8D=E7=BD=AE=E7=9A=84va?= =?UTF-8?q?lue=E4=B8=BAstring=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Cuiziyuan --- .../service/data_share/data_share_profile_config.cpp | 6 +++++- .../service/data_share/data_share_service_impl.cpp | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) 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 f8fe35004..021b27e1d 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 4043d0511..64fb1958d 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_); } -- Gitee