当前位置: 首页 > news >正文

建设小企业网站步骤怎么做好网络营销推广

建设小企业网站步骤,怎么做好网络营销推广,网站推广排名收费,北京大兴做网站公司分布式帐号管理 本模块提供管理分布式帐号的一些基础功能,主要包括查询和更新帐号登录状态。 说明: 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。开发前请熟悉鸿蒙开发指导文档&#xff…

分布式帐号管理

本模块提供管理分布式帐号的一些基础功能,主要包括查询和更新帐号登录状态。

说明: 本模块首批接口从API version 7开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。开发前请熟悉鸿蒙开发指导文档gitee.com/li-shizhen-skin/harmony-os/blob/master/README.md点击或者复制转到。

导入模块

import account_distributedAccount from '@ohos.account.distributedAccount';

account_distributedAccount.getDistributedAccountAbility

getDistributedAccountAbility(): DistributedAccountAbility

获取分布式帐号单实例对象。

系统能力: SystemCapability.Account.OsAccount

  • 返回值:

    | 类型 | 说明 |
    | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------- |
    | [DistributedAccountAbility]| 返回一个实例,实例提供查询和更新分布式帐号登录状态方法。 |

  • 示例:

    const accountAbility = account_distributedAccount.getDistributedAccountAbility();
    

DistributedAccountAbility

提供查询和更新分布式帐号登录状态方法(需要先获取分布式帐号的单实例对象)。

queryOsAccountDistributedInfo

queryOsAccountDistributedInfo(callback: AsyncCallback): void

获取分布式帐号信息,使用callback回调异步返回结果。

系统能力: SystemCapability.Account.OsAccount

需要权限: ohos.permission.MANAGE_LOCAL_ACCOUNTS 或 ohos.permission.DISTRIBUTED_DATASYNC,该权限仅供系统应用使用。

  • 参数:

    | 参数名 | 类型 | 必填 | 说明 |
    | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | – | ------------- |
    | callback | AsyncCallback<[DistributedInfo]> | 是 | 获取分布式帐号信息的回调。 |

  • 示例:

    const accountAbility = account_distributedAccount.getDistributedAccountAbility();
    accountAbility.queryOsAccountDistributedInfo((err, data) => { console.log("queryOsAccountDistributedInfo err: " + JSON.stringify(err));console.log('Query account info name: ' + data.name);console.log('Query account info id: ' + data.id);
    });
    

queryOsAccountDistributedInfo

queryOsAccountDistributedInfo(): Promise

获取分布式帐号信息,使用Promise方式异步返回结果。

系统能力: SystemCapability.Account.OsAccount

需要权限: ohos.permission.MANAGE_LOCAL_ACCOUNTS 或 ohos.permission.DISTRIBUTED_DATASYNC,该权限仅供系统应用使用。

  • 返回值:

    | 类型 | 说明 |
    | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------- |
    | Promise<[DistributedInfo]> | Promise实例,用于获取异步返回结果。 |

  • 示例:

    const accountAbility = account_distributedAccount.getDistributedAccountAbility();
    accountAbility.queryOsAccountDistributedInfo().then((data) => { console.log('Query account info name: ' + data.name);console.log('Query account info id: ' + data.id);
    }).catch((err) => {console.log("queryOsAccountDistributedInfoerr: "  + JSON.stringify(err));
    });
    

updateOsAccountDistributedInfo

updateOsAccountDistributedInfo(accountInfo: DistributedInfo, callback: AsyncCallback): void

更新分布式帐号信息,使用callback回调异步返回结果。

系统能力: SystemCapability.Account.OsAccount

需要权限: ohos.permission.MANAGE_LOCAL_ACCOUNTS,该权限仅供系统应用使用。

  • 参数:

    | 参数名 | 类型 | 必填 | 说明 |
    | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | – | ------------- |
    | accountInfo | [DistributedInfo]| 是 | 分布式帐号信息。 |
    | callback | AsyncCallback | 是 | 更新分布式帐号信息的回调。 |

  • 示例:

    const accountAbility = account_distributedAccount.getDistributedAccountAbility();
    let accountInfo = {id: '12345', name: 'ZhangSan', event: 'Ohos.account.event.LOGIN'};
    accountAbility.updateOsAccountDistributedInfo(accountInfo, (err) => { console.log("queryOsAccountDistributedInfo err: " + JSON.stringify(err));
    });
    

updateOsAccountDistributedInfo

updateOsAccountDistributedInfo(accountInfo: DistributedInfo): Promise

更新分布式帐号信息,使用Promise方式异步返回结果。

系统能力: SystemCapability.Account.OsAccount

需要权限: ohos.permission.MANAGE_LOCAL_ACCOUNTS,该权限仅供系统应用使用。

  • 参数:

    | 参数名 | 类型 | 必填 | 说明 |
    | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- | – | -------- |
    | accountInfo | [DistributedInfo] | 是 | 分布式帐户信息。 |

  • 返回值:

    | 类型 | 说明 |
    | ------------- | --------------------- |
    | Promise | Promise实例,用于获取异步返回结果。 |

  • 示例:

    const accountAbility = account_distributedAccount.getDistributedAccountAbility();
    let accountInfo = {id: '12345', name: 'ZhangSan', event: 'Ohos.account.event.LOGIN'};
    accountAbility.updateOsAccountDistributedInfo(accountInfo).then(() => {console.log('updateOsAccountDistributedInfo Success');}).catch((err) => {console.log("updateOsAccountDistributedInfo err: "  + JSON.stringify(err));
    });
    

DistributedInfo

提供操作系统帐户的分布式信息。

系统能力: SystemCapability.Account.OsAccount

在这里插入图片描述

参数名类型必填说明
namestring分布式帐号名称,非空字符串。
idstring分布式帐号UID,非空字符串。
eventstring分布式帐号登录状态,包括登录、登出、Token失效和注销,分别对应以下字符串: - Ohos.account.event.LOGIN - Ohos.account.event.LOGOUT - Ohos.account.event.TOKEN_INVALID - Ohos.account.event.LOGOFF
scalableDataobject分布式帐号扩展信息,根据业务所需,以k-v形式传递定制化信息。 说明:该参数是预留的可选项,目前查询和更新的方法实现中未使用。
http://www.dt0577.cn/news/394.html

相关文章:

  • 成都微官网制作游戏优化大师官方下载
  • 郑州网站建设一汉狮网络网络搜索引擎
  • 天津网站制作公司电话亚马逊关键词优化软件
  • 如何做好网站开发项目需求分析网站生成app
  • 采用什么方法推广网站百度站长社区
  • 优秀网站首页设计步骤网页搜索快捷键是什么
  • 常平东莞网站设计国内做seo最好的公司
  • 灰色调网站电脑培训网
  • 个人网站备案怎么写店铺运营
  • 网站的类型有哪些北京网站推广营销策划
  • 建设信用中国网站的目的网站宣传推广方案
  • 网站上线前应该备案吗免费的短视频app大全下载
  • 清远医院网站建设方案北京网上推广
  • 网站和discuz同步登录优化营商环境工作开展情况汇报
  • 网站设计一般包括什么企业网站制作教程
  • 淘宝网电脑版登录入口常州百度seo排名
  • node怎么做网站2345网址导航电脑版
  • 泰安网络设计公司网页seo
  • 有没有专门做装修的网站百度指数官网入口
  • 书画展示网站源码5118素材网站
  • 常用的网站推广方法有哪些专业竞价托管哪家好
  • 不用写代码做的网站2345导网址导航下载
  • 5g站长工具查询简述什么是百度竞价排名
  • 建站wordpress源码交易网站源码
  • 免费个人网站制作提高工作效率英语
  • 那个网站可以做宣传学生网页制作成品
  • 手机怎么做网站服务器吗如何做网络推广推广
  • 网站如何做实名认证免费推广的途径与原因
  • 建设网站需要注意什么四川省最新疫情情况
  • 属于网站开发工具的是武汉网站维护公司