diff --git a/interfaces/innerkits/napi/src/user_auth_helper.cpp b/interfaces/innerkits/napi/src/user_auth_helper.cpp old mode 100755 new mode 100644 index f73e4a8..c53db77 --- a/interfaces/innerkits/napi/src/user_auth_helper.cpp +++ b/interfaces/innerkits/napi/src/user_auth_helper.cpp @@ -213,6 +213,12 @@ void Init(napi_env env, napi_value exports) status = napi_define_properties(env, exports, sizeof(exportFuncs) / sizeof(*exportFuncs), exportFuncs); if (status != napi_ok) { USERAUTH_HILOGE(MODULE_JS_NAPI, "napi_define_properties faild"); + return; + } + + status = napi_set_named_property(env, exports, "UserAuth", GetCtor(env)); + if (status != napi_ok) { + USERAUTH_HILOGE(MODULE_JS_NAPI, "napi_set_named_property faild"); } } diff --git a/interfaces/kits/napi/src/user_auth_helper_north.cpp b/interfaces/kits/napi/src/user_auth_helper_north.cpp old mode 100755 new mode 100644 index ed0a34f..55228d6 --- a/interfaces/kits/napi/src/user_auth_helper_north.cpp +++ b/interfaces/kits/napi/src/user_auth_helper_north.cpp @@ -55,6 +55,12 @@ void Init(napi_env env, napi_value exports) status = napi_define_properties(env, exports, sizeof(exportFuncs) / sizeof(*exportFuncs), exportFuncs); if (status != napi_ok) { USERAUTH_HILOGE(MODULE_JS_NAPI, "napi_define_properties faild"); + return; + } + + status = napi_set_named_property(env, exports, "UserAuthNorth", GetCtor(env)); + if (status != napi_ok) { + USERAUTH_HILOGE(MODULE_JS_NAPI, "napi_set_named_property faild"); } }