diff --git a/interfaces/innerkits/napi/src/auth_build.cpp b/interfaces/innerkits/napi/src/auth_build.cpp index 0f6f59f..2c6cef4 100644 --- a/interfaces/innerkits/napi/src/auth_build.cpp +++ b/interfaces/innerkits/napi/src/auth_build.cpp @@ -33,7 +33,7 @@ Napi_SetPropertyRequest AuthBuild::SetPropertyRequestBuild(napi_env env, napi_va return request; } request.authType_ = convert_.GetInt32ValueByKey(env, object, "authType"); - request.key_ = (uint32_t)convert_.GetInt32ValueByKey(env, object, "key"); + request.key_ = static_cast(convert_.GetInt32ValueByKey(env, object, "key")); request.setInfo_ = convert_.NapiGetValueUint8Array(env, object, "setInfo"); USERAUTH_HILOGI(MODULE_JS_NAPI, "AuthBuild::SetPropertyRequestBuild authType = %{public}d", request.authType_); diff --git a/services/src/userauth_service.cpp b/services/src/userauth_service.cpp index 06bc3a5..1e8b0c6 100644 --- a/services/src/userauth_service.cpp +++ b/services/src/userauth_service.cpp @@ -138,7 +138,7 @@ void UserAuthService::GetProperty(const GetPropertyRequest request, sptrGetCallingUid(); + callerID = static_cast(this->GetCallingUid()); callerName = std::to_string(callerID); userauthController_.GetPropAuthInfo(userID, callerName, callerID, request, callback); @@ -165,7 +165,7 @@ void UserAuthService::SetProperty(const SetPropertyRequest request, sptrGetCallingUid(); + callerID = static_cast(this->GetCallingUid()); callerName = std::to_string(callerID); ret = userauthController_.SetExecutorProp(callerID, callerName, request, callback); @@ -322,7 +322,7 @@ int32_t UserAuthService::GetControllerData(sptr &callback, Au return FAIL; } - callerID = (uint64_t)this->GetCallingUid(); + callerID = static_cast(this->GetCallingUid()); callerName = std::to_string(callerID); if (userauthController_.GenerateContextID(contextID) != SUCCESS) {