From 76f62f64ab0c8f7e073087c1a9282e0256268bc2 Mon Sep 17 00:00:00 2001 From: zxf Date: Mon, 25 Aug 2025 14:39:46 +0800 Subject: [PATCH] =?UTF-8?q?rss=E6=8E=A5=E5=8F=A3=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E8=B4=9F=E8=BD=BD=E5=9C=BA=E6=99=AF=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zxf --- .../napi/scene_session_manager/js_rss_session.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/window_scene/interfaces/kits/napi/scene_session_manager/js_rss_session.cpp b/window_scene/interfaces/kits/napi/scene_session_manager/js_rss_session.cpp index 313497e52e..9c3d7258ed 100644 --- a/window_scene/interfaces/kits/napi/scene_session_manager/js_rss_session.cpp +++ b/window_scene/interfaces/kits/napi/scene_session_manager/js_rss_session.cpp @@ -112,6 +112,11 @@ void SetMapValue(napi_env env, const std::string& key, const T& value, napi_valu napi_set_property(env, object, keyInfo, valueInfo); } +bool IsJsonString(const nlohmann::json& payload, const std::string& key) +{ + return payload.contains(key) && payload[key].is_string(); +} + napi_value RssSession::DealRssReply(napi_env env, const nlohmann::json& payload, const nlohmann::json& reply) { WLOGFI("[NAPI]"); @@ -122,6 +127,12 @@ napi_value RssSession::DealRssReply(napi_env env, const nlohmann::json& payload, return NapiGetUndefined(env); } + if (IsJsonString(reply, "resultType") && reply.at("resultType") == "loadSceneJudgement" && + IsJsonString(reply, "resultValue")) { + SetMapValue(env, "result", reply["resultValue"].get(), objValue); + return objValue; + } + if (!reply.contains("result") || !reply["result"].is_string() || reply.at("result") == "") { WLOGFE("Reply not find result key!"); return NapiGetUndefined(env); -- Gitee