From 70f30b04f00147734353b7275ff985870d71f4bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=B2=E6=99=93=E6=99=93?= Date: Wed, 8 May 2024 18:40:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E7=AD=96=E7=95=A5=E5=8F=91?= =?UTF-8?q?=E7=8E=B0=E5=92=8C=E6=97=A0=E4=BA=A4=E4=BA=92=E8=AE=A4=E8=AF=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 史晓晓 --- interfaces/kits/js4.0/src/dm_native_util.cpp | 9 +++++++++ .../src/authentication/dm_auth_manager.cpp | 1 + 2 files changed, 10 insertions(+) diff --git a/interfaces/kits/js4.0/src/dm_native_util.cpp b/interfaces/kits/js4.0/src/dm_native_util.cpp index 02de1eaa..9fb74f20 100644 --- a/interfaces/kits/js4.0/src/dm_native_util.cpp +++ b/interfaces/kits/js4.0/src/dm_native_util.cpp @@ -363,6 +363,15 @@ bool JsToDiscoverTargetType(napi_env env, const napi_value &object, int32_t &dis void JsToDmDiscoveryExtra(const napi_env &env, const napi_value &object, std::string &extra) { + bool hasProperty = false; + NAPI_CALL_RETURN_VOID(env, napi_has_named_property(env, object, "discoveryPolicy", &hasProperty)); + if (hasProperty) { + char discoveryPolicy[DM_NAPI_DESCRIPTION_BUF_LENGTH] = ""; + JsObjectToString(env, object, "discoveryPolicy", discoveryPolicy, sizeof(discoveryPolicy)); + extra = std::string(discoveryPolicy); + return; + } + nlohmann::json jsonObj; int32_t availableStatus = DM_NAPI_DISCOVER_EXTRA_INIT_ONE; JsObjectToInt(env, object, "availableStatus", availableStatus); diff --git a/services/implementation/src/authentication/dm_auth_manager.cpp b/services/implementation/src/authentication/dm_auth_manager.cpp index fd3943c0..7d61db0b 100644 --- a/services/implementation/src/authentication/dm_auth_manager.cpp +++ b/services/implementation/src/authentication/dm_auth_manager.cpp @@ -79,6 +79,7 @@ DmAuthManager::DmAuthManager(std::shared_ptr softbusConnector, authUiStateMgr_ = std::make_shared(listener_); authenticationMap_[AUTH_TYPE_IMPORT_AUTH_CODE] = nullptr; authenticationMap_[AUTH_TYPE_CRE] = nullptr; + authenticationMap_[AUTH_TYPE_NO_INTER_ACTION] = nullptr; dmVersion_ = DM_VERSION; } -- Gitee