Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
080370fb
D
Docs
项目概览
OpenHarmony
/
Docs
大约 2 年 前同步成功
通知
161
Star
293
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
080370fb
编写于
9月 01, 2023
作者:
O
openharmony_ci
提交者:
Gitee
9月 01, 2023
浏览文件
操作
浏览文件
下载
差异文件
!23669 账号docs示例代码语言标记更改
Merge pull request !23669 from cc_ggboy/monthly_20230815
上级
5a8241f5
0069cc4c
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
284 addition
and
284 deletion
+284
-284
zh-cn/application-dev/reference/apis/js-apis-appAccount.md
zh-cn/application-dev/reference/apis/js-apis-appAccount.md
+119
-119
zh-cn/application-dev/reference/apis/js-apis-distributed-account.md
...ication-dev/reference/apis/js-apis-distributed-account.md
+14
-14
zh-cn/application-dev/reference/apis/js-apis-osAccount.md
zh-cn/application-dev/reference/apis/js-apis-osAccount.md
+151
-151
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-appAccount.md
浏览文件 @
080370fb
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
## 导入模块
## 导入模块
```
j
s
```
t
s
import
account_appAccount
from
'
@ohos.account.appAccount
'
;
import
account_appAccount
from
'
@ohos.account.appAccount
'
;
```
```
...
@@ -29,7 +29,7 @@ createAppAccountManager(): AppAccountManager
...
@@ -29,7 +29,7 @@ createAppAccountManager(): AppAccountManager
| AppAccountManager | 应用帐号管理器对象。 |
| AppAccountManager | 应用帐号管理器对象。 |
**示例:**
**示例:**
```
j
s
```
t
s
let
appAccountManager
=
account_appAccount
.
createAppAccountManager
();
let
appAccountManager
=
account_appAccount
.
createAppAccountManager
();
```
```
...
@@ -63,7 +63,7 @@ createAccount(name: string, callback: AsyncCallback<void>): void;
...
@@ -63,7 +63,7 @@ createAccount(name: string, callback: AsyncCallback<void>): void;
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
try
{
try
{
...
@@ -102,7 +102,7 @@ createAccount(name: string, options: CreateAccountOptions, callback: AsyncCallba
...
@@ -102,7 +102,7 @@ createAccount(name: string, options: CreateAccountOptions, callback: AsyncCallba
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
options
:
account_appAccount
.
CreateAccountOptions
=
{
let
options
:
account_appAccount
.
CreateAccountOptions
=
{
...
@@ -155,7 +155,7 @@ createAccount(name: string, options?: CreateAccountOptions): Promise<void>
...
@@ -155,7 +155,7 @@ createAccount(name: string, options?: CreateAccountOptions): Promise<void>
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
options
:
account_appAccount
.
CreateAccountOptions
=
{
let
options
:
account_appAccount
.
CreateAccountOptions
=
{
...
@@ -202,7 +202,7 @@ createAccountImplicitly(owner: string, callback: AuthCallback): void
...
@@ -202,7 +202,7 @@ createAccountImplicitly(owner: string, callback: AuthCallback): void
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
Want
from
'
@ohos.app.ability.Want
'
;
import
Want
from
'
@ohos.app.ability.Want
'
;
import
common
from
'
@ohos.app.ability.common
'
;
import
common
from
'
@ohos.app.ability.common
'
;
...
@@ -267,7 +267,7 @@ createAccountImplicitly(owner: string, options: CreateAccountImplicitlyOptions,
...
@@ -267,7 +267,7 @@ createAccountImplicitly(owner: string, options: CreateAccountImplicitlyOptions,
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
Want
from
'
@ohos.app.ability.Want
'
;
import
Want
from
'
@ohos.app.ability.Want
'
;
import
common
from
'
@ohos.app.ability.common
'
;
import
common
from
'
@ohos.app.ability.common
'
;
...
@@ -332,7 +332,7 @@ removeAccount(name: string, callback: AsyncCallback<void>): void
...
@@ -332,7 +332,7 @@ removeAccount(name: string, callback: AsyncCallback<void>): void
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
try
{
try
{
...
@@ -378,7 +378,7 @@ removeAccount(name: string): Promise<void>
...
@@ -378,7 +378,7 @@ removeAccount(name: string): Promise<void>
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
try
{
try
{
...
@@ -420,7 +420,7 @@ setAppAccess(name: string, bundleName: string, isAccessible: boolean, callback:
...
@@ -420,7 +420,7 @@ setAppAccess(name: string, bundleName: string, isAccessible: boolean, callback:
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
try
{
try
{
...
@@ -469,7 +469,7 @@ setAppAccess(name: string, bundleName: string, isAccessible: boolean): Promise&l
...
@@ -469,7 +469,7 @@ setAppAccess(name: string, bundleName: string, isAccessible: boolean): Promise&l
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
try
{
try
{
...
@@ -509,7 +509,7 @@ checkAppAccess(name: string, bundleName: string, callback: AsyncCallback<bool
...
@@ -509,7 +509,7 @@ checkAppAccess(name: string, bundleName: string, callback: AsyncCallback<bool
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
try
{
try
{
...
@@ -557,7 +557,7 @@ checkAppAccess(name: string, bundleName: string): Promise<boolean>
...
@@ -557,7 +557,7 @@ checkAppAccess(name: string, bundleName: string): Promise<boolean>
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
try
{
try
{
...
@@ -599,7 +599,7 @@ setDataSyncEnabled(name: string, isEnabled: boolean, callback: AsyncCallback<
...
@@ -599,7 +599,7 @@ setDataSyncEnabled(name: string, isEnabled: boolean, callback: AsyncCallback<
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
try
{
try
{
...
@@ -644,7 +644,7 @@ setDataSyncEnabled(name: string, isEnabled: boolean): Promise<void>
...
@@ -644,7 +644,7 @@ setDataSyncEnabled(name: string, isEnabled: boolean): Promise<void>
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
try
{
try
{
...
@@ -685,7 +685,7 @@ checkDataSyncEnabled(name: string, callback: AsyncCallback<boolean>): void
...
@@ -685,7 +685,7 @@ checkDataSyncEnabled(name: string, callback: AsyncCallback<boolean>): void
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
try
{
try
{
...
@@ -733,7 +733,7 @@ checkDataSyncEnabled(name: string): Promise<boolean>
...
@@ -733,7 +733,7 @@ checkDataSyncEnabled(name: string): Promise<boolean>
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
try
{
try
{
...
@@ -774,7 +774,7 @@ setCredential(name: string, credentialType: string, credential: string,callback:
...
@@ -774,7 +774,7 @@ setCredential(name: string, credentialType: string, credential: string,callback:
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
try
{
try
{
...
@@ -822,7 +822,7 @@ setCredential(name: string, credentialType: string, credential: string): Promise
...
@@ -822,7 +822,7 @@ setCredential(name: string, credentialType: string, credential: string): Promise
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
try
{
try
{
...
@@ -863,7 +863,7 @@ getCredential(name: string, credentialType: string, callback: AsyncCallback<s
...
@@ -863,7 +863,7 @@ getCredential(name: string, credentialType: string, callback: AsyncCallback<s
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
try
{
try
{
...
@@ -911,7 +911,7 @@ getCredential(name: string, credentialType: string): Promise<string>
...
@@ -911,7 +911,7 @@ getCredential(name: string, credentialType: string): Promise<string>
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
try
{
try
{
...
@@ -953,7 +953,7 @@ setCustomData(name: string, key: string, value: string, callback: AsyncCallback&
...
@@ -953,7 +953,7 @@ setCustomData(name: string, key: string, value: string, callback: AsyncCallback&
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
try
{
try
{
...
@@ -1002,7 +1002,7 @@ setCustomData(name: string, key: string, value: string): Promise<void>
...
@@ -1002,7 +1002,7 @@ setCustomData(name: string, key: string, value: string): Promise<void>
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
try
{
try
{
...
@@ -1043,7 +1043,7 @@ getCustomData(name: string, key: string, callback: AsyncCallback<string>):
...
@@ -1043,7 +1043,7 @@ getCustomData(name: string, key: string, callback: AsyncCallback<string>):
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
try
{
try
{
...
@@ -1091,7 +1091,7 @@ getCustomData(name: string, key: string): Promise<string>
...
@@ -1091,7 +1091,7 @@ getCustomData(name: string, key: string): Promise<string>
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
try
{
try
{
...
@@ -1137,7 +1137,7 @@ getCustomDataSync(name: string, key: string): string;
...
@@ -1137,7 +1137,7 @@ getCustomDataSync(name: string, key: string): string;
**示例:**
**示例:**
```
j
s
```
t
s
try
{
try
{
let
value
=
appAccountManager
.
getCustomDataSync
(
'
ZhangSan
'
,
'
age
'
);
let
value
=
appAccountManager
.
getCustomDataSync
(
'
ZhangSan
'
,
'
age
'
);
console
.
info
(
'
getCustomDataSync successfully, vaue:
'
+
value
);
console
.
info
(
'
getCustomDataSync successfully, vaue:
'
+
value
);
...
@@ -1168,7 +1168,7 @@ getAllAccounts(callback: AsyncCallback<Array<AppAccountInfo>>): void
...
@@ -1168,7 +1168,7 @@ getAllAccounts(callback: AsyncCallback<Array<AppAccountInfo>>): void
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
try
{
try
{
...
@@ -1206,7 +1206,7 @@ getAllAccounts(): Promise<Array<AppAccountInfo>>
...
@@ -1206,7 +1206,7 @@ getAllAccounts(): Promise<Array<AppAccountInfo>>
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
try
{
try
{
...
@@ -1245,7 +1245,7 @@ getAccountsByOwner(owner: string, callback: AsyncCallback<Array<AppAccount
...
@@ -1245,7 +1245,7 @@ getAccountsByOwner(owner: string, callback: AsyncCallback<Array<AppAccount
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
try
{
try
{
...
@@ -1292,7 +1292,7 @@ getAccountsByOwner(owner: string): Promise<Array<AppAccountInfo>>
...
@@ -1292,7 +1292,7 @@ getAccountsByOwner(owner: string): Promise<Array<AppAccountInfo>>
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
try
{
try
{
...
@@ -1333,7 +1333,7 @@ on(type: 'accountChange', owners: Array<string>, callback: Callback<Arr
...
@@ -1333,7 +1333,7 @@ on(type: 'accountChange', owners: Array<string>, callback: Callback<Arr
**示例:**
**示例:**
```
j
s
```
t
s
function
changeOnCallback
(
data
:
account_appAccount
.
AppAccountInfo
[]):
void
{
function
changeOnCallback
(
data
:
account_appAccount
.
AppAccountInfo
[]):
void
{
console
.
log
(
'
receive change data:
'
+
JSON
.
stringify
(
data
));
console
.
log
(
'
receive change data:
'
+
JSON
.
stringify
(
data
));
}
}
...
@@ -1368,7 +1368,7 @@ off(type: 'accountChange', callback?: Callback<Array<AppAccountInfo>>
...
@@ -1368,7 +1368,7 @@ off(type: 'accountChange', callback?: Callback<Array<AppAccountInfo>>
**示例:**
**示例:**
```
j
s
```
t
s
function
changeOnCallback
(
data
:
account_appAccount
.
AppAccountInfo
[]):
void
{
function
changeOnCallback
(
data
:
account_appAccount
.
AppAccountInfo
[]):
void
{
console
.
log
(
'
receive change data:
'
+
JSON
.
stringify
(
data
));
console
.
log
(
'
receive change data:
'
+
JSON
.
stringify
(
data
));
}
}
...
@@ -1415,7 +1415,7 @@ auth(name: string, owner: string, authType: string, callback: AuthCallback): voi
...
@@ -1415,7 +1415,7 @@ auth(name: string, owner: string, authType: string, callback: AuthCallback): voi
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
Want
from
'
@ohos.app.ability.Want
'
;
import
Want
from
'
@ohos.app.ability.Want
'
;
import
common
from
'
@ohos.app.ability.common
'
;
import
common
from
'
@ohos.app.ability.common
'
;
...
@@ -1482,7 +1482,7 @@ auth(name: string, owner: string, authType: string, options: {[key: string]: Obj
...
@@ -1482,7 +1482,7 @@ auth(name: string, owner: string, authType: string, options: {[key: string]: Obj
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
Want
from
'
@ohos.app.ability.Want
'
;
import
Want
from
'
@ohos.app.ability.Want
'
;
import
common
from
'
@ohos.app.ability.common
'
;
import
common
from
'
@ohos.app.ability.common
'
;
...
@@ -1549,7 +1549,7 @@ getAuthToken(name: string, owner: string, authType: string, callback: AsyncCallb
...
@@ -1549,7 +1549,7 @@ getAuthToken(name: string, owner: string, authType: string, callback: AsyncCallb
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
try
{
try
{
...
@@ -1599,7 +1599,7 @@ getAuthToken(name: string, owner: string, authType: string): Promise<string&g
...
@@ -1599,7 +1599,7 @@ getAuthToken(name: string, owner: string, authType: string): Promise<string&g
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
try
{
try
{
...
@@ -1641,7 +1641,7 @@ setAuthToken(name: string, authType: string, token: string, callback: AsyncCallb
...
@@ -1641,7 +1641,7 @@ setAuthToken(name: string, authType: string, token: string, callback: AsyncCallb
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
try
{
try
{
...
@@ -1690,7 +1690,7 @@ setAuthToken(name: string, authType: string, token: string): Promise<void>
...
@@ -1690,7 +1690,7 @@ setAuthToken(name: string, authType: string, token: string): Promise<void>
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
try
{
try
{
...
@@ -1733,7 +1733,7 @@ deleteAuthToken(name: string, owner: string, authType: string, token: string, ca
...
@@ -1733,7 +1733,7 @@ deleteAuthToken(name: string, owner: string, authType: string, token: string, ca
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
try
{
try
{
...
@@ -1784,7 +1784,7 @@ deleteAuthToken(name: string, owner: string, authType: string, token: string): P
...
@@ -1784,7 +1784,7 @@ deleteAuthToken(name: string, owner: string, authType: string, token: string): P
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
try
{
try
{
...
@@ -1829,7 +1829,7 @@ setAuthTokenVisibility(name: string, authType: string, bundleName: string, isVis
...
@@ -1829,7 +1829,7 @@ setAuthTokenVisibility(name: string, authType: string, bundleName: string, isVis
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
try
{
try
{
...
@@ -1882,7 +1882,7 @@ setAuthTokenVisibility(name: string, authType: string, bundleName: string, isVis
...
@@ -1882,7 +1882,7 @@ setAuthTokenVisibility(name: string, authType: string, bundleName: string, isVis
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
try
{
try
{
...
@@ -1924,7 +1924,7 @@ checkAuthTokenVisibility(name: string, authType: string, bundleName: string, cal
...
@@ -1924,7 +1924,7 @@ checkAuthTokenVisibility(name: string, authType: string, bundleName: string, cal
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
try
{
try
{
...
@@ -1974,7 +1974,7 @@ checkAuthTokenVisibility(name: string, authType: string, bundleName: string): Pr
...
@@ -1974,7 +1974,7 @@ checkAuthTokenVisibility(name: string, authType: string, bundleName: string): Pr
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
try
{
try
{
...
@@ -2015,7 +2015,7 @@ getAllAuthTokens(name: string, owner: string, callback: AsyncCallback<Array&l
...
@@ -2015,7 +2015,7 @@ getAllAuthTokens(name: string, owner: string, callback: AsyncCallback<Array&l
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
try
{
try
{
...
@@ -2063,7 +2063,7 @@ getAllAuthTokens(name: string, owner: string): Promise<Array<AuthTokenInfo
...
@@ -2063,7 +2063,7 @@ getAllAuthTokens(name: string, owner: string): Promise<Array<AuthTokenInfo
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
try
{
try
{
...
@@ -2105,7 +2105,7 @@ getAuthList(name: string, authType: string, callback: AsyncCallback<Array<
...
@@ -2105,7 +2105,7 @@ getAuthList(name: string, authType: string, callback: AsyncCallback<Array<
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
try
{
try
{
...
@@ -2153,7 +2153,7 @@ getAuthList(name: string, authType: string): Promise<Array<string>>
...
@@ -2153,7 +2153,7 @@ getAuthList(name: string, authType: string): Promise<Array<string>>
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
try
{
try
{
...
@@ -2192,7 +2192,7 @@ getAuthCallback(sessionId: string, callback: AsyncCallback<AuthCallback>):
...
@@ -2192,7 +2192,7 @@ getAuthCallback(sessionId: string, callback: AsyncCallback<AuthCallback>):
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
UIAbility
from
'
@ohos.app.ability.UIAbility
'
;
import
UIAbility
from
'
@ohos.app.ability.UIAbility
'
;
import
Want
from
'
@ohos.app.ability.Want
'
;
import
Want
from
'
@ohos.app.ability.Want
'
;
...
@@ -2256,7 +2256,7 @@ getAuthCallback(sessionId: string): Promise<AuthCallback>
...
@@ -2256,7 +2256,7 @@ getAuthCallback(sessionId: string): Promise<AuthCallback>
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
UIAbility
from
'
@ohos.app.ability.UIAbility
'
;
import
UIAbility
from
'
@ohos.app.ability.UIAbility
'
;
import
Want
from
'
@ohos.app.ability.Want
'
;
import
Want
from
'
@ohos.app.ability.Want
'
;
...
@@ -2313,7 +2313,7 @@ queryAuthenticatorInfo(owner: string, callback: AsyncCallback<AuthenticatorIn
...
@@ -2313,7 +2313,7 @@ queryAuthenticatorInfo(owner: string, callback: AsyncCallback<AuthenticatorIn
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
try
{
try
{
...
@@ -2360,7 +2360,7 @@ queryAuthenticatorInfo(owner: string): Promise<AuthenticatorInfo>
...
@@ -2360,7 +2360,7 @@ queryAuthenticatorInfo(owner: string): Promise<AuthenticatorInfo>
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
try
{
try
{
...
@@ -2405,7 +2405,7 @@ checkAccountLabels(name: string, owner: string, labels: Array<string>, cal
...
@@ -2405,7 +2405,7 @@ checkAccountLabels(name: string, owner: string, labels: Array<string>, cal
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
labels
=
[
'
student
'
];
let
labels
=
[
'
student
'
];
...
@@ -2458,7 +2458,7 @@ checkAccountLabels(name: string, owner: string, labels: Array<string>): Pr
...
@@ -2458,7 +2458,7 @@ checkAccountLabels(name: string, owner: string, labels: Array<string>): Pr
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
labels
=
[
'
student
'
];
let
labels
=
[
'
student
'
];
...
@@ -2501,7 +2501,7 @@ deleteCredential(name: string, credentialType: string, callback: AsyncCallback&l
...
@@ -2501,7 +2501,7 @@ deleteCredential(name: string, credentialType: string, callback: AsyncCallback&l
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
try
{
try
{
...
@@ -2549,7 +2549,7 @@ deleteCredential(name: string, credentialType: string): Promise<void>
...
@@ -2549,7 +2549,7 @@ deleteCredential(name: string, credentialType: string): Promise<void>
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
try
{
try
{
...
@@ -2589,7 +2589,7 @@ selectAccountsByOptions(options: SelectAccountsOptions, callback: AsyncCallback&
...
@@ -2589,7 +2589,7 @@ selectAccountsByOptions(options: SelectAccountsOptions, callback: AsyncCallback&
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
options
:
account_appAccount
.
SelectAccountsOptions
=
{
let
options
:
account_appAccount
.
SelectAccountsOptions
=
{
...
@@ -2641,7 +2641,7 @@ selectAccountsByOptions(options: SelectAccountsOptions): Promise<Array<App
...
@@ -2641,7 +2641,7 @@ selectAccountsByOptions(options: SelectAccountsOptions): Promise<Array<App
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
options
:
account_appAccount
.
SelectAccountsOptions
=
{
let
options
:
account_appAccount
.
SelectAccountsOptions
=
{
...
@@ -2687,7 +2687,7 @@ verifyCredential(name: string, owner: string, callback: AuthCallback): void;
...
@@ -2687,7 +2687,7 @@ verifyCredential(name: string, owner: string, callback: AuthCallback): void;
**示例:**
**示例:**
```
j
s
```
t
s
import
Want
from
'
@ohos.app.ability.Want
'
;
import
Want
from
'
@ohos.app.ability.Want
'
;
try
{
try
{
...
@@ -2735,7 +2735,7 @@ verifyCredential(name: string, owner: string, options: VerifyCredentialOptions,
...
@@ -2735,7 +2735,7 @@ verifyCredential(name: string, owner: string, options: VerifyCredentialOptions,
**示例:**
**示例:**
```
j
s
```
t
s
import
Want
from
'
@ohos.app.ability.Want
'
;
import
Want
from
'
@ohos.app.ability.Want
'
;
let
options
:
account_appAccount
.
VerifyCredentialOptions
=
{
let
options
:
account_appAccount
.
VerifyCredentialOptions
=
{
...
@@ -2784,7 +2784,7 @@ setAuthenticatorProperties(owner: string, callback: AuthCallback): void;
...
@@ -2784,7 +2784,7 @@ setAuthenticatorProperties(owner: string, callback: AuthCallback): void;
**示例:**
**示例:**
```
j
s
```
t
s
import
Want
from
'
@ohos.app.ability.Want
'
;
import
Want
from
'
@ohos.app.ability.Want
'
;
try
{
try
{
...
@@ -2830,7 +2830,7 @@ setAuthenticatorProperties(owner: string, options: SetPropertiesOptions, callbac
...
@@ -2830,7 +2830,7 @@ setAuthenticatorProperties(owner: string, options: SetPropertiesOptions, callbac
**示例:**
**示例:**
```
j
s
```
t
s
import
Want
from
'
@ohos.app.ability.Want
'
;
import
Want
from
'
@ohos.app.ability.Want
'
;
let
options
:
account_appAccount
.
SetPropertiesOptions
=
{
let
options
:
account_appAccount
.
SetPropertiesOptions
=
{
...
@@ -2874,7 +2874,7 @@ addAccount(name: string, callback: AsyncCallback<void>): void
...
@@ -2874,7 +2874,7 @@ addAccount(name: string, callback: AsyncCallback<void>): void
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
appAccountManager
.
addAccount
(
'
WangWu
'
,
(
err
:
BusinessError
)
=>
{
appAccountManager
.
addAccount
(
'
WangWu
'
,
(
err
:
BusinessError
)
=>
{
...
@@ -2903,7 +2903,7 @@ addAccount(name: string, extraInfo: string, callback: AsyncCallback<void>)
...
@@ -2903,7 +2903,7 @@ addAccount(name: string, extraInfo: string, callback: AsyncCallback<void>)
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
appAccountManager
.
addAccount
(
'
LiSi
'
,
'
token101
'
,
(
err
:
BusinessError
)
=>
{
appAccountManager
.
addAccount
(
'
LiSi
'
,
'
token101
'
,
(
err
:
BusinessError
)
=>
{
...
@@ -2937,7 +2937,7 @@ addAccount(name: string, extraInfo?: string): Promise<void>
...
@@ -2937,7 +2937,7 @@ addAccount(name: string, extraInfo?: string): Promise<void>
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
appAccountManager
.
addAccount
(
'
LiSi
'
,
'
token101
'
).
then
(()
=>
{
appAccountManager
.
addAccount
(
'
LiSi
'
,
'
token101
'
).
then
(()
=>
{
...
@@ -2970,7 +2970,7 @@ addAccountImplicitly(owner: string, authType: string, options: {[key: string]: a
...
@@ -2970,7 +2970,7 @@ addAccountImplicitly(owner: string, authType: string, options: {[key: string]: a
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
Want
from
'
@ohos.app.ability.Want
'
;
import
Want
from
'
@ohos.app.ability.Want
'
;
import
common
from
'
@ohos.app.ability.common
'
;
import
common
from
'
@ohos.app.ability.common
'
;
...
@@ -3023,7 +3023,7 @@ deleteAccount(name: string, callback: AsyncCallback<void>): void
...
@@ -3023,7 +3023,7 @@ deleteAccount(name: string, callback: AsyncCallback<void>): void
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
appAccountManager
.
deleteAccount
(
'
ZhaoLiu
'
,
(
err
:
BusinessError
)
=>
{
appAccountManager
.
deleteAccount
(
'
ZhaoLiu
'
,
(
err
:
BusinessError
)
=>
{
...
@@ -3057,7 +3057,7 @@ deleteAccount(name: string): Promise<void>
...
@@ -3057,7 +3057,7 @@ deleteAccount(name: string): Promise<void>
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
appAccountManager
.
deleteAccount
(
'
ZhaoLiu
'
).
then
(()
=>
{
appAccountManager
.
deleteAccount
(
'
ZhaoLiu
'
).
then
(()
=>
{
...
@@ -3088,7 +3088,7 @@ disableAppAccess(name: string, bundleName: string, callback: AsyncCallback<vo
...
@@ -3088,7 +3088,7 @@ disableAppAccess(name: string, bundleName: string, callback: AsyncCallback<vo
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
appAccountManager
.
disableAppAccess
(
'
ZhangSan
'
,
'
com.example.accountjsdemo
'
,
(
err
:
BusinessError
)
=>
{
appAccountManager
.
disableAppAccess
(
'
ZhangSan
'
,
'
com.example.accountjsdemo
'
,
(
err
:
BusinessError
)
=>
{
...
@@ -3123,7 +3123,7 @@ disableAppAccess(name: string, bundleName: string): Promise<void>
...
@@ -3123,7 +3123,7 @@ disableAppAccess(name: string, bundleName: string): Promise<void>
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
appAccountManager
.
disableAppAccess
(
'
ZhangSan
'
,
'
com.example.accountjsdemo
'
).
then
(()
=>
{
appAccountManager
.
disableAppAccess
(
'
ZhangSan
'
,
'
com.example.accountjsdemo
'
).
then
(()
=>
{
...
@@ -3155,7 +3155,7 @@ enableAppAccess(name: string, bundleName: string, callback: AsyncCallback<voi
...
@@ -3155,7 +3155,7 @@ enableAppAccess(name: string, bundleName: string, callback: AsyncCallback<voi
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
appAccountManager
.
enableAppAccess
(
'
ZhangSan
'
,
'
com.example.accountjsdemo
'
,
(
err
:
BusinessError
)
=>
{
appAccountManager
.
enableAppAccess
(
'
ZhangSan
'
,
'
com.example.accountjsdemo
'
,
(
err
:
BusinessError
)
=>
{
...
@@ -3190,7 +3190,7 @@ enableAppAccess(name: string, bundleName: string): Promise<void>
...
@@ -3190,7 +3190,7 @@ enableAppAccess(name: string, bundleName: string): Promise<void>
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
appAccountManager
.
enableAppAccess
(
'
ZhangSan
'
,
'
com.example.accountjsdemo
'
).
then
(()
=>
{
appAccountManager
.
enableAppAccess
(
'
ZhangSan
'
,
'
com.example.accountjsdemo
'
).
then
(()
=>
{
...
@@ -3223,7 +3223,7 @@ checkAppAccountSyncEnable(name: string, callback: AsyncCallback<boolean>):
...
@@ -3223,7 +3223,7 @@ checkAppAccountSyncEnable(name: string, callback: AsyncCallback<boolean>):
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
appAccountManager
.
checkAppAccountSyncEnable
(
'
ZhangSan
'
,
(
err
:
BusinessError
,
result
:
boolean
)
=>
{
appAccountManager
.
checkAppAccountSyncEnable
(
'
ZhangSan
'
,
(
err
:
BusinessError
,
result
:
boolean
)
=>
{
...
@@ -3260,7 +3260,7 @@ checkAppAccountSyncEnable(name: string): Promise<boolean>
...
@@ -3260,7 +3260,7 @@ checkAppAccountSyncEnable(name: string): Promise<boolean>
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
appAccountManager
.
checkAppAccountSyncEnable
(
'
ZhangSan
'
).
then
((
data
:
boolean
)
=>
{
appAccountManager
.
checkAppAccountSyncEnable
(
'
ZhangSan
'
).
then
((
data
:
boolean
)
=>
{
...
@@ -3293,7 +3293,7 @@ setAccountCredential(name: string, credentialType: string, credential: string,ca
...
@@ -3293,7 +3293,7 @@ setAccountCredential(name: string, credentialType: string, credential: string,ca
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
appAccountManager
.
setAccountCredential
(
'
ZhangSan
'
,
'
credentialType001
'
,
'
credential001
'
,
(
err
:
BusinessError
)
=>
{
appAccountManager
.
setAccountCredential
(
'
ZhangSan
'
,
'
credentialType001
'
,
'
credential001
'
,
(
err
:
BusinessError
)
=>
{
...
@@ -3329,7 +3329,7 @@ setAccountCredential(name: string, credentialType: string, credential: string):
...
@@ -3329,7 +3329,7 @@ setAccountCredential(name: string, credentialType: string, credential: string):
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
appAccountManager
.
setAccountCredential
(
'
ZhangSan
'
,
'
credentialType001
'
,
'
credential001
'
).
then
(()
=>
{
appAccountManager
.
setAccountCredential
(
'
ZhangSan
'
,
'
credentialType001
'
,
'
credential001
'
).
then
(()
=>
{
...
@@ -3362,7 +3362,7 @@ setAccountExtraInfo(name: string, extraInfo: string, callback: AsyncCallback<
...
@@ -3362,7 +3362,7 @@ setAccountExtraInfo(name: string, extraInfo: string, callback: AsyncCallback<
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
appAccountManager
.
setAccountExtraInfo
(
'
ZhangSan
'
,
'
Tk002
'
,
(
err
:
BusinessError
)
=>
{
appAccountManager
.
setAccountExtraInfo
(
'
ZhangSan
'
,
'
Tk002
'
,
(
err
:
BusinessError
)
=>
{
...
@@ -3398,7 +3398,7 @@ setAccountExtraInfo(name: string, extraInfo: string): Promise<void>
...
@@ -3398,7 +3398,7 @@ setAccountExtraInfo(name: string, extraInfo: string): Promise<void>
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
appAccountManager
.
setAccountExtraInfo
(
'
ZhangSan
'
,
'
Tk002
'
).
then
(()
=>
{
appAccountManager
.
setAccountExtraInfo
(
'
ZhangSan
'
,
'
Tk002
'
).
then
(()
=>
{
...
@@ -3432,7 +3432,7 @@ setAppAccountSyncEnable(name: string, isEnable: boolean, callback: AsyncCallback
...
@@ -3432,7 +3432,7 @@ setAppAccountSyncEnable(name: string, isEnable: boolean, callback: AsyncCallback
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
appAccountManager
.
setAppAccountSyncEnable
(
'
ZhangSan
'
,
true
,
(
err
:
BusinessError
)
=>
{
appAccountManager
.
setAppAccountSyncEnable
(
'
ZhangSan
'
,
true
,
(
err
:
BusinessError
)
=>
{
...
@@ -3469,7 +3469,7 @@ setAppAccountSyncEnable(name: string, isEnable: boolean): Promise<void>
...
@@ -3469,7 +3469,7 @@ setAppAccountSyncEnable(name: string, isEnable: boolean): Promise<void>
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
appAccountManager
.
setAppAccountSyncEnable
(
'
ZhangSan
'
,
true
).
then
(()
=>
{
appAccountManager
.
setAppAccountSyncEnable
(
'
ZhangSan
'
,
true
).
then
(()
=>
{
...
@@ -3503,7 +3503,7 @@ setAssociatedData(name: string, key: string, value: string, callback: AsyncCallb
...
@@ -3503,7 +3503,7 @@ setAssociatedData(name: string, key: string, value: string, callback: AsyncCallb
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
appAccountManager
.
setAssociatedData
(
'
ZhangSan
'
,
'
k001
'
,
'
v001
'
,
(
err
:
BusinessError
)
=>
{
appAccountManager
.
setAssociatedData
(
'
ZhangSan
'
,
'
k001
'
,
'
v001
'
,
(
err
:
BusinessError
)
=>
{
...
@@ -3540,7 +3540,7 @@ setAssociatedData(name: string, key: string, value: string): Promise<void>
...
@@ -3540,7 +3540,7 @@ setAssociatedData(name: string, key: string, value: string): Promise<void>
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
appAccountManager
.
setAssociatedData
(
'
ZhangSan
'
,
'
k001
'
,
'
v001
'
).
then
(()
=>
{
appAccountManager
.
setAssociatedData
(
'
ZhangSan
'
,
'
k001
'
,
'
v001
'
).
then
(()
=>
{
...
@@ -3572,7 +3572,7 @@ getAllAccessibleAccounts(callback: AsyncCallback<Array<AppAccountInfo>&
...
@@ -3572,7 +3572,7 @@ getAllAccessibleAccounts(callback: AsyncCallback<Array<AppAccountInfo>&
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
appAccountManager
.
getAllAccessibleAccounts
((
err
:
BusinessError
,
data
:
account_appAccount
.
AppAccountInfo
[])
=>
{
appAccountManager
.
getAllAccessibleAccounts
((
err
:
BusinessError
,
data
:
account_appAccount
.
AppAccountInfo
[])
=>
{
...
@@ -3603,7 +3603,7 @@ getAllAccessibleAccounts(): Promise<Array<AppAccountInfo>>
...
@@ -3603,7 +3603,7 @@ getAllAccessibleAccounts(): Promise<Array<AppAccountInfo>>
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
appAccountManager
.
getAllAccessibleAccounts
().
then
((
data
:
account_appAccount
.
AppAccountInfo
[])
=>
{
appAccountManager
.
getAllAccessibleAccounts
().
then
((
data
:
account_appAccount
.
AppAccountInfo
[])
=>
{
...
@@ -3636,7 +3636,7 @@ getAllAccounts(owner: string, callback: AsyncCallback<Array<AppAccountInfo
...
@@ -3636,7 +3636,7 @@ getAllAccounts(owner: string, callback: AsyncCallback<Array<AppAccountInfo
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
const
selfBundle
=
'
com.example.actsgetallaaccounts
'
;
const
selfBundle
=
'
com.example.actsgetallaaccounts
'
;
...
@@ -3674,7 +3674,7 @@ getAllAccounts(owner: string): Promise<Array<AppAccountInfo>>
...
@@ -3674,7 +3674,7 @@ getAllAccounts(owner: string): Promise<Array<AppAccountInfo>>
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
const
selfBundle
=
'
com.example.actsgetallaaccounts
'
;
const
selfBundle
=
'
com.example.actsgetallaaccounts
'
;
...
@@ -3707,7 +3707,7 @@ getAccountCredential(name: string, credentialType: string, callback: AsyncCallba
...
@@ -3707,7 +3707,7 @@ getAccountCredential(name: string, credentialType: string, callback: AsyncCallba
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
appAccountManager
.
getAccountCredential
(
'
ZhangSan
'
,
'
credentialType001
'
,
(
err
:
BusinessError
,
result
:
string
)
=>
{
appAccountManager
.
getAccountCredential
(
'
ZhangSan
'
,
'
credentialType001
'
,
(
err
:
BusinessError
,
result
:
string
)
=>
{
...
@@ -3743,7 +3743,7 @@ getAccountCredential(name: string, credentialType: string): Promise<string>
...
@@ -3743,7 +3743,7 @@ getAccountCredential(name: string, credentialType: string): Promise<string>
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
appAccountManager
.
getAccountCredential
(
'
ZhangSan
'
,
'
credentialType001
'
).
then
((
data
:
string
)
=>
{
appAccountManager
.
getAccountCredential
(
'
ZhangSan
'
,
'
credentialType001
'
).
then
((
data
:
string
)
=>
{
...
@@ -3774,7 +3774,7 @@ getAccountExtraInfo(name: string, callback: AsyncCallback<string>): void
...
@@ -3774,7 +3774,7 @@ getAccountExtraInfo(name: string, callback: AsyncCallback<string>): void
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
appAccountManager
.
getAccountExtraInfo
(
'
ZhangSan
'
,
(
err
:
BusinessError
,
result
:
string
)
=>
{
appAccountManager
.
getAccountExtraInfo
(
'
ZhangSan
'
,
(
err
:
BusinessError
,
result
:
string
)
=>
{
...
@@ -3809,7 +3809,7 @@ getAccountExtraInfo(name: string): Promise<string>
...
@@ -3809,7 +3809,7 @@ getAccountExtraInfo(name: string): Promise<string>
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
appAccountManager
.
getAccountExtraInfo
(
'
ZhangSan
'
).
then
((
data
:
string
)
=>
{
appAccountManager
.
getAccountExtraInfo
(
'
ZhangSan
'
).
then
((
data
:
string
)
=>
{
...
@@ -3841,7 +3841,7 @@ getAssociatedData(name: string, key: string, callback: AsyncCallback<string&g
...
@@ -3841,7 +3841,7 @@ getAssociatedData(name: string, key: string, callback: AsyncCallback<string&g
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
appAccountManager
.
getAssociatedData
(
'
ZhangSan
'
,
'
k001
'
,
(
err
:
BusinessError
,
result
:
string
)
=>
{
appAccountManager
.
getAssociatedData
(
'
ZhangSan
'
,
'
k001
'
,
(
err
:
BusinessError
,
result
:
string
)
=>
{
...
@@ -3877,7 +3877,7 @@ getAssociatedData(name: string, key: string): Promise<string>
...
@@ -3877,7 +3877,7 @@ getAssociatedData(name: string, key: string): Promise<string>
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
appAccountManager
.
getAssociatedData
(
'
ZhangSan
'
,
'
k001
'
).
then
((
data
:
string
)
=>
{
appAccountManager
.
getAssociatedData
(
'
ZhangSan
'
,
'
k001
'
).
then
((
data
:
string
)
=>
{
...
@@ -3909,7 +3909,7 @@ on(type: 'change', owners: Array<string>, callback: Callback<Array<A
...
@@ -3909,7 +3909,7 @@ on(type: 'change', owners: Array<string>, callback: Callback<Array<A
**示例:**
**示例:**
```
j
s
```
t
s
function
changeOnCallback
(
data
:
account_appAccount
.
AppAccountInfo
[]):
void
{
function
changeOnCallback
(
data
:
account_appAccount
.
AppAccountInfo
[]):
void
{
console
.
debug
(
'
receive change data:
'
+
JSON
.
stringify
(
data
));
console
.
debug
(
'
receive change data:
'
+
JSON
.
stringify
(
data
));
}
}
...
@@ -3942,7 +3942,7 @@ off(type: 'change', callback?: Callback<Array<AppAccountInfo>>): voi
...
@@ -3942,7 +3942,7 @@ off(type: 'change', callback?: Callback<Array<AppAccountInfo>>): voi
**示例:**
**示例:**
```
j
s
```
t
s
function
changeOnCallback
(
data
:
account_appAccount
.
AppAccountInfo
[]):
void
{
function
changeOnCallback
(
data
:
account_appAccount
.
AppAccountInfo
[]):
void
{
console
.
debug
(
'
receive change data:
'
+
JSON
.
stringify
(
data
));
console
.
debug
(
'
receive change data:
'
+
JSON
.
stringify
(
data
));
appAccountManager
.
off
(
'
change
'
,
()
=>
{
appAccountManager
.
off
(
'
change
'
,
()
=>
{
...
@@ -3981,7 +3981,7 @@ authenticate(name: string, owner: string, authType: string, options: {[key: stri
...
@@ -3981,7 +3981,7 @@ authenticate(name: string, owner: string, authType: string, options: {[key: stri
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
Want
from
'
@ohos.app.ability.Want
'
;
import
Want
from
'
@ohos.app.ability.Want
'
;
import
common
from
'
@ohos.app.ability.common
'
;
import
common
from
'
@ohos.app.ability.common
'
;
...
@@ -4036,7 +4036,7 @@ getOAuthToken(name: string, owner: string, authType: string, callback: AsyncCall
...
@@ -4036,7 +4036,7 @@ getOAuthToken(name: string, owner: string, authType: string, callback: AsyncCall
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
appAccountManager
.
getOAuthToken
(
'
LiSi
'
,
'
com.example.accountjsdemo
'
,
'
getSocialData
'
,
appAccountManager
.
getOAuthToken
(
'
LiSi
'
,
'
com.example.accountjsdemo
'
,
'
getSocialData
'
,
...
@@ -4074,7 +4074,7 @@ getOAuthToken(name: string, owner: string, authType: string): Promise<string&
...
@@ -4074,7 +4074,7 @@ getOAuthToken(name: string, owner: string, authType: string): Promise<string&
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
appAccountManager
.
getOAuthToken
(
'
LiSi
'
,
'
com.example.accountjsdemo
'
,
'
getSocialData
'
).
then
((
data
:
string
)
=>
{
appAccountManager
.
getOAuthToken
(
'
LiSi
'
,
'
com.example.accountjsdemo
'
,
'
getSocialData
'
).
then
((
data
:
string
)
=>
{
...
@@ -4107,7 +4107,7 @@ setOAuthToken(name: string, authType: string, token: string, callback: AsyncCall
...
@@ -4107,7 +4107,7 @@ setOAuthToken(name: string, authType: string, token: string, callback: AsyncCall
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
appAccountManager
.
setOAuthToken
(
'
LiSi
'
,
'
getSocialData
'
,
'
xxxx
'
,
(
err
:
BusinessError
)
=>
{
appAccountManager
.
setOAuthToken
(
'
LiSi
'
,
'
getSocialData
'
,
'
xxxx
'
,
(
err
:
BusinessError
)
=>
{
...
@@ -4143,7 +4143,7 @@ setOAuthToken(name: string, authType: string, token: string): Promise<void>
...
@@ -4143,7 +4143,7 @@ setOAuthToken(name: string, authType: string, token: string): Promise<void>
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
appAccountManager
.
setOAuthToken
(
'
LiSi
'
,
'
getSocialData
'
,
'
xxxx
'
).
then
(()
=>
{
appAccountManager
.
setOAuthToken
(
'
LiSi
'
,
'
getSocialData
'
,
'
xxxx
'
).
then
(()
=>
{
...
@@ -4177,7 +4177,7 @@ deleteOAuthToken(name: string, owner: string, authType: string, token: string, c
...
@@ -4177,7 +4177,7 @@ deleteOAuthToken(name: string, owner: string, authType: string, token: string, c
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
appAccountManager
.
deleteOAuthToken
(
'
LiSi
'
,
'
com.example.accountjsdemo
'
,
'
getSocialData
'
,
'
xxxxx
'
,
appAccountManager
.
deleteOAuthToken
(
'
LiSi
'
,
'
com.example.accountjsdemo
'
,
'
getSocialData
'
,
'
xxxxx
'
,
...
@@ -4215,7 +4215,7 @@ deleteOAuthToken(name: string, owner: string, authType: string, token: string):
...
@@ -4215,7 +4215,7 @@ deleteOAuthToken(name: string, owner: string, authType: string, token: string):
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
appAccountManager
.
deleteOAuthToken
(
'
LiSi
'
,
'
com.example.accountjsdemo
'
,
'
getSocialData
'
,
'
xxxxx
'
).
then
(()
=>
{
appAccountManager
.
deleteOAuthToken
(
'
LiSi
'
,
'
com.example.accountjsdemo
'
,
'
getSocialData
'
,
'
xxxxx
'
).
then
(()
=>
{
...
@@ -4249,7 +4249,7 @@ setOAuthTokenVisibility(name: string, authType: string, bundleName: string, isVi
...
@@ -4249,7 +4249,7 @@ setOAuthTokenVisibility(name: string, authType: string, bundleName: string, isVi
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
appAccountManager
.
setOAuthTokenVisibility
(
'
LiSi
'
,
'
getSocialData
'
,
'
com.example.accountjsdemo
'
,
true
,
appAccountManager
.
setOAuthTokenVisibility
(
'
LiSi
'
,
'
getSocialData
'
,
'
com.example.accountjsdemo
'
,
true
,
...
@@ -4287,7 +4287,7 @@ setOAuthTokenVisibility(name: string, authType: string, bundleName: string, isVi
...
@@ -4287,7 +4287,7 @@ setOAuthTokenVisibility(name: string, authType: string, bundleName: string, isVi
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
appAccountManager
.
setOAuthTokenVisibility
(
'
LiSi
'
,
'
getSocialData
'
,
'
com.example.accountjsdemo
'
,
true
).
then
(()
=>
{
appAccountManager
.
setOAuthTokenVisibility
(
'
LiSi
'
,
'
getSocialData
'
,
'
com.example.accountjsdemo
'
,
true
).
then
(()
=>
{
...
@@ -4320,7 +4320,7 @@ checkOAuthTokenVisibility(name: string, authType: string, bundleName: string, ca
...
@@ -4320,7 +4320,7 @@ checkOAuthTokenVisibility(name: string, authType: string, bundleName: string, ca
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
appAccountManager
.
checkOAuthTokenVisibility
(
'
LiSi
'
,
'
getSocialData
'
,
'
com.example.accountjsdemo
'
,
appAccountManager
.
checkOAuthTokenVisibility
(
'
LiSi
'
,
'
getSocialData
'
,
'
com.example.accountjsdemo
'
,
...
@@ -4358,7 +4358,7 @@ checkOAuthTokenVisibility(name: string, authType: string, bundleName: string): P
...
@@ -4358,7 +4358,7 @@ checkOAuthTokenVisibility(name: string, authType: string, bundleName: string): P
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
appAccountManager
.
checkOAuthTokenVisibility
(
'
LiSi
'
,
'
getSocialData
'
,
'
com.example.accountjsdemo
'
).
then
((
appAccountManager
.
checkOAuthTokenVisibility
(
'
LiSi
'
,
'
getSocialData
'
,
'
com.example.accountjsdemo
'
).
then
((
...
@@ -4391,7 +4391,7 @@ getAllOAuthTokens(name: string, owner: string, callback: AsyncCallback<Array&
...
@@ -4391,7 +4391,7 @@ getAllOAuthTokens(name: string, owner: string, callback: AsyncCallback<Array&
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
appAccountManager
.
getAllOAuthTokens
(
'
LiSi
'
,
'
com.example.accountjsdemo
'
,
appAccountManager
.
getAllOAuthTokens
(
'
LiSi
'
,
'
com.example.accountjsdemo
'
,
...
@@ -4428,7 +4428,7 @@ getAllOAuthTokens(name: string, owner: string): Promise<Array<OAuthTokenIn
...
@@ -4428,7 +4428,7 @@ getAllOAuthTokens(name: string, owner: string): Promise<Array<OAuthTokenIn
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
appAccountManager
.
getAllOAuthTokens
(
'
LiSi
'
,
'
com.example.accountjsdemo
'
).
then
((
appAccountManager
.
getAllOAuthTokens
(
'
LiSi
'
,
'
com.example.accountjsdemo
'
).
then
((
...
@@ -4461,7 +4461,7 @@ getOAuthList(name: string, authType: string, callback: AsyncCallback<Array<
...
@@ -4461,7 +4461,7 @@ getOAuthList(name: string, authType: string, callback: AsyncCallback<Array<
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
appAccountManager
.
getOAuthList
(
'
LiSi
'
,
'
getSocialData
'
,
(
err
:
BusinessError
,
data
:
string
[])
=>
{
appAccountManager
.
getOAuthList
(
'
LiSi
'
,
'
getSocialData
'
,
(
err
:
BusinessError
,
data
:
string
[])
=>
{
...
@@ -4497,7 +4497,7 @@ getOAuthList(name: string, authType: string): Promise<Array<string>>
...
@@ -4497,7 +4497,7 @@ getOAuthList(name: string, authType: string): Promise<Array<string>>
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
appAccountManager
.
getOAuthList
(
'
LiSi
'
,
'
getSocialData
'
).
then
((
data
:
string
[])
=>
{
appAccountManager
.
getOAuthList
(
'
LiSi
'
,
'
getSocialData
'
).
then
((
data
:
string
[])
=>
{
...
@@ -4528,7 +4528,7 @@ getAuthenticatorCallback(sessionId: string, callback: AsyncCallback<Authentic
...
@@ -4528,7 +4528,7 @@ getAuthenticatorCallback(sessionId: string, callback: AsyncCallback<Authentic
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
UIAbility
from
'
@ohos.app.ability.UIAbility
'
;
import
UIAbility
from
'
@ohos.app.ability.UIAbility
'
;
import
Want
from
'
@ohos.app.ability.Want
'
;
import
Want
from
'
@ohos.app.ability.Want
'
;
...
@@ -4580,7 +4580,7 @@ getAuthenticatorCallback(sessionId: string): Promise<AuthenticatorCallback>
...
@@ -4580,7 +4580,7 @@ getAuthenticatorCallback(sessionId: string): Promise<AuthenticatorCallback>
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
UIAbility
from
'
@ohos.app.ability.UIAbility
'
;
import
UIAbility
from
'
@ohos.app.ability.UIAbility
'
;
import
Want
from
'
@ohos.app.ability.Want
'
;
import
Want
from
'
@ohos.app.ability.Want
'
;
...
@@ -4625,7 +4625,7 @@ getAuthenticatorInfo(owner: string, callback: AsyncCallback<AuthenticatorInfo
...
@@ -4625,7 +4625,7 @@ getAuthenticatorInfo(owner: string, callback: AsyncCallback<AuthenticatorInfo
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
appAccountManager
.
getAuthenticatorInfo
(
'
com.example.accountjsdemo
'
,
appAccountManager
.
getAuthenticatorInfo
(
'
com.example.accountjsdemo
'
,
...
@@ -4661,7 +4661,7 @@ getAuthenticatorInfo(owner: string): Promise<AuthenticatorInfo>
...
@@ -4661,7 +4661,7 @@ getAuthenticatorInfo(owner: string): Promise<AuthenticatorInfo>
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
appAccountManager
.
getAuthenticatorInfo
(
'
com.example.accountjsdemo
'
).
then
((
appAccountManager
.
getAuthenticatorInfo
(
'
com.example.accountjsdemo
'
).
then
((
...
@@ -4869,7 +4869,7 @@ onResult: (code: number, result?: AuthResult) => void
...
@@ -4869,7 +4869,7 @@ onResult: (code: number, result?: AuthResult) => void
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
appAccountManager
=
account_appAccount
.
createAppAccountManager
();
let
appAccountManager
=
account_appAccount
.
createAppAccountManager
();
...
@@ -4907,7 +4907,7 @@ onRequestRedirected: (request: Want) => void
...
@@ -4907,7 +4907,7 @@ onRequestRedirected: (request: Want) => void
**示例:**
**示例:**
```
j
s
```
t
s
class
MyAuthenticator
extends
account_appAccount
.
Authenticator
{
class
MyAuthenticator
extends
account_appAccount
.
Authenticator
{
createAccountImplicitly
(
createAccountImplicitly
(
options
:
account_appAccount
.
CreateAccountImplicitlyOptions
,
callback
:
account_appAccount
.
AuthCallback
)
{
options
:
account_appAccount
.
CreateAccountImplicitlyOptions
,
callback
:
account_appAccount
.
AuthCallback
)
{
...
@@ -4945,7 +4945,7 @@ onRequestContinued?: () => void
...
@@ -4945,7 +4945,7 @@ onRequestContinued?: () => void
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
appAccountManager
=
account_appAccount
.
createAppAccountManager
();
let
appAccountManager
=
account_appAccount
.
createAppAccountManager
();
...
@@ -4984,7 +4984,7 @@ onResult: (code: number, result: {[key: string]: any}) => void
...
@@ -4984,7 +4984,7 @@ onResult: (code: number, result: {[key: string]: any}) => void
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
appAccountManager
=
account_appAccount
.
createAppAccountManager
();
let
appAccountManager
=
account_appAccount
.
createAppAccountManager
();
...
@@ -5017,7 +5017,7 @@ onRequestRedirected: (request: Want) => void
...
@@ -5017,7 +5017,7 @@ onRequestRedirected: (request: Want) => void
**示例:**
**示例:**
```
j
s
```
t
s
class
MyAuthenticator
extends
account_appAccount
.
Authenticator
{
class
MyAuthenticator
extends
account_appAccount
.
Authenticator
{
addAccountImplicitly
(
authType
:
string
,
callerBundleName
:
string
,
addAccountImplicitly
(
authType
:
string
,
callerBundleName
:
string
,
options
:
Record
<
string
,
Object
>
,
callback
:
account_appAccount
.
AuthenticatorCallback
)
{
options
:
Record
<
string
,
Object
>
,
callback
:
account_appAccount
.
AuthenticatorCallback
)
{
...
@@ -5191,7 +5191,7 @@ getRemoteObject(): rpc.RemoteObject;
...
@@ -5191,7 +5191,7 @@ getRemoteObject(): rpc.RemoteObject;
**示例:**
**示例:**
```
j
s
```
t
s
import
rpc
from
'
@ohos.rpc
'
;
import
rpc
from
'
@ohos.rpc
'
;
class
MyAuthenticator
extends
account_appAccount
.
Authenticator
{
class
MyAuthenticator
extends
account_appAccount
.
Authenticator
{
...
...
zh-cn/application-dev/reference/apis/js-apis-distributed-account.md
浏览文件 @
080370fb
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
## 导入模块
## 导入模块
```
j
s
```
t
s
import
account_distributedAccount
from
'
@ohos.account.distributedAccount
'
;
import
account_distributedAccount
from
'
@ohos.account.distributedAccount
'
;
```
```
...
@@ -27,7 +27,7 @@ getDistributedAccountAbility(): DistributedAccountAbility
...
@@ -27,7 +27,7 @@ getDistributedAccountAbility(): DistributedAccountAbility
|
[
DistributedAccountAbility
](
#distributedaccountability
)
| 返回一个实例,实例提供查询和更新分布式帐号登录状态方法。 |
|
[
DistributedAccountAbility
](
#distributedaccountability
)
| 返回一个实例,实例提供查询和更新分布式帐号登录状态方法。 |
**示例:**
**示例:**
```
j
s
```
t
s
const
accountAbility
=
account_distributedAccount
.
getDistributedAccountAbility
();
const
accountAbility
=
account_distributedAccount
.
getDistributedAccountAbility
();
```
```
...
@@ -58,7 +58,7 @@ getOsAccountDistributedInfo(callback: AsyncCallback<DistributedInfo>): voi
...
@@ -58,7 +58,7 @@ getOsAccountDistributedInfo(callback: AsyncCallback<DistributedInfo>): voi
| 12300001 | System service exception. |
| 12300001 | System service exception. |
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
const
accountAbility
=
account_distributedAccount
.
getDistributedAccountAbility
();
const
accountAbility
=
account_distributedAccount
.
getDistributedAccountAbility
();
...
@@ -99,7 +99,7 @@ getOsAccountDistributedInfo(): Promise<DistributedInfo>
...
@@ -99,7 +99,7 @@ getOsAccountDistributedInfo(): Promise<DistributedInfo>
| 12300001 | System service exception. |
| 12300001 | System service exception. |
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
const
accountAbility
=
account_distributedAccount
.
getDistributedAccountAbility
();
const
accountAbility
=
account_distributedAccount
.
getDistributedAccountAbility
();
...
@@ -141,7 +141,7 @@ getOsAccountDistributedInfoByLocalId(localId: number, callback: AsyncCallback<
...
@@ -141,7 +141,7 @@ getOsAccountDistributedInfoByLocalId(localId: number, callback: AsyncCallback<
| 12300003 | Account not found. |
| 12300003 | Account not found. |
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
const
accountAbility
=
account_distributedAccount
.
getDistributedAccountAbility
();
const
accountAbility
=
account_distributedAccount
.
getDistributedAccountAbility
();
...
@@ -185,7 +185,7 @@ getOsAccountDistributedInfoByLocalId(localId: number): Promise<DistributedInf
...
@@ -185,7 +185,7 @@ getOsAccountDistributedInfoByLocalId(localId: number): Promise<DistributedInf
| 12300003 | Account not found. |
| 12300003 | Account not found. |
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
const
accountAbility
=
account_distributedAccount
.
getDistributedAccountAbility
();
const
accountAbility
=
account_distributedAccount
.
getDistributedAccountAbility
();
...
@@ -221,7 +221,7 @@ queryOsAccountDistributedInfo(callback: AsyncCallback<DistributedInfo>): v
...
@@ -221,7 +221,7 @@ queryOsAccountDistributedInfo(callback: AsyncCallback<DistributedInfo>): v
| callback | AsyncCallback
<
[DistributedInfo](#distributedinfo)
>
| 是 | 回调函数。当获取分布式帐号信息成功,err为undefined,data为获取到的分布式帐号信息对象;否则为错误对象。 |
| callback | AsyncCallback
<
[DistributedInfo](#distributedinfo)
>
| 是 | 回调函数。当获取分布式帐号信息成功,err为undefined,data为获取到的分布式帐号信息对象;否则为错误对象。 |
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
const
accountAbility
=
account_distributedAccount
.
getDistributedAccountAbility
();
const
accountAbility
=
account_distributedAccount
.
getDistributedAccountAbility
();
...
@@ -256,7 +256,7 @@ queryOsAccountDistributedInfo(): Promise<DistributedInfo>
...
@@ -256,7 +256,7 @@ queryOsAccountDistributedInfo(): Promise<DistributedInfo>
| Promise
<
[DistributedInfo](#distributedinfo)
>
| Promise对象,返回分布式帐号信息对象。 |
| Promise
<
[DistributedInfo](#distributedinfo)
>
| Promise对象,返回分布式帐号信息对象。 |
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
const
accountAbility
=
account_distributedAccount
.
getDistributedAccountAbility
();
const
accountAbility
=
account_distributedAccount
.
getDistributedAccountAbility
();
...
@@ -293,7 +293,7 @@ setOsAccountDistributedInfo(accountInfo: DistributedInfo, callback: AsyncCallbac
...
@@ -293,7 +293,7 @@ setOsAccountDistributedInfo(accountInfo: DistributedInfo, callback: AsyncCallbac
| 12300003 | Account not found. |
| 12300003 | Account not found. |
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
const
accountAbility
=
account_distributedAccount
.
getDistributedAccountAbility
();
const
accountAbility
=
account_distributedAccount
.
getDistributedAccountAbility
();
...
@@ -343,7 +343,7 @@ setOsAccountDistributedInfo(accountInfo: DistributedInfo): Promise<void>
...
@@ -343,7 +343,7 @@ setOsAccountDistributedInfo(accountInfo: DistributedInfo): Promise<void>
| 12300003 | Account not found. |
| 12300003 | Account not found. |
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
const
accountAbility
=
account_distributedAccount
.
getDistributedAccountAbility
();
const
accountAbility
=
account_distributedAccount
.
getDistributedAccountAbility
();
...
@@ -389,7 +389,7 @@ setOsAccountDistributedInfoByLocalId(localId: number, distributedInfo: Distribut
...
@@ -389,7 +389,7 @@ setOsAccountDistributedInfoByLocalId(localId: number, distributedInfo: Distribut
| 12300008 | Restricted OS account. |
| 12300008 | Restricted OS account. |
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
const
accountAbility
=
account_distributedAccount
.
getDistributedAccountAbility
();
const
accountAbility
=
account_distributedAccount
.
getDistributedAccountAbility
();
...
@@ -443,7 +443,7 @@ setOsAccountDistributedInfoByLocalId(localId: number, distributedInfo: Distribut
...
@@ -443,7 +443,7 @@ setOsAccountDistributedInfoByLocalId(localId: number, distributedInfo: Distribut
| 12300008 | Restricted OS account. |
| 12300008 | Restricted OS account. |
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
const
accountAbility
=
account_distributedAccount
.
getDistributedAccountAbility
();
const
accountAbility
=
account_distributedAccount
.
getDistributedAccountAbility
();
...
@@ -482,7 +482,7 @@ updateOsAccountDistributedInfo(accountInfo: DistributedInfo, callback: AsyncCall
...
@@ -482,7 +482,7 @@ updateOsAccountDistributedInfo(accountInfo: DistributedInfo, callback: AsyncCall
| callback | AsyncCallback
<
void
>
| 是 | 回调函数。当更新分布式帐号信息成功时,err为undefined,否则为错误对象。 |
| callback | AsyncCallback
<
void
>
| 是 | 回调函数。当更新分布式帐号信息成功时,err为undefined,否则为错误对象。 |
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
const
accountAbility
=
account_distributedAccount
.
getDistributedAccountAbility
();
const
accountAbility
=
account_distributedAccount
.
getDistributedAccountAbility
();
...
@@ -522,7 +522,7 @@ updateOsAccountDistributedInfo(accountInfo: DistributedInfo): Promise<void>
...
@@ -522,7 +522,7 @@ updateOsAccountDistributedInfo(accountInfo: DistributedInfo): Promise<void>
| Promise
<
void
>
| Promise对象,无返回结果的Promise对象。 |
| Promise
<
void
>
| Promise对象,无返回结果的Promise对象。 |
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
const
accountAbility
=
account_distributedAccount
.
getDistributedAccountAbility
();
const
accountAbility
=
account_distributedAccount
.
getDistributedAccountAbility
();
...
...
zh-cn/application-dev/reference/apis/js-apis-osAccount.md
浏览文件 @
080370fb
...
@@ -9,7 +9,7 @@
...
@@ -9,7 +9,7 @@
## 导入模块
## 导入模块
```
j
s
```
t
s
import
account_osAccount
from
'
@ohos.account.osAccount
'
;
import
account_osAccount
from
'
@ohos.account.osAccount
'
;
```
```
...
@@ -28,7 +28,7 @@ getAccountManager(): AccountManager
...
@@ -28,7 +28,7 @@ getAccountManager(): AccountManager
|
[
AccountManager
](
#accountmanager
)
| 系统帐号管理对象。 |
|
[
AccountManager
](
#accountmanager
)
| 系统帐号管理对象。 |
**示例:**
**示例:**
```
j
s
```
t
s
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
```
```
...
@@ -78,7 +78,7 @@ activateOsAccount(localId: number, callback: AsyncCallback<void>): void
...
@@ -78,7 +78,7 @@ activateOsAccount(localId: number, callback: AsyncCallback<void>): void
| 12300009 | Account has been activated. |
| 12300009 | Account has been activated. |
**示例:**
激活ID为100的系统帐号
**示例:**
激活ID为100的系统帐号
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
localId
:
number
=
100
;
let
localId
:
number
=
100
;
try
{
try
{
...
@@ -129,7 +129,7 @@ activateOsAccount(localId: number): Promise<void>
...
@@ -129,7 +129,7 @@ activateOsAccount(localId: number): Promise<void>
| 12300009 | Account has been activated. |
| 12300009 | Account has been activated. |
**示例:**
激活ID为100的系统帐号
**示例:**
激活ID为100的系统帐号
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
localId
:
number
=
100
;
let
localId
:
number
=
100
;
...
@@ -166,7 +166,7 @@ checkMultiOsAccountEnabled(callback: AsyncCallback<boolean>): void
...
@@ -166,7 +166,7 @@ checkMultiOsAccountEnabled(callback: AsyncCallback<boolean>): void
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
try
{
try
{
...
@@ -204,7 +204,7 @@ checkMultiOsAccountEnabled(): Promise<boolean>
...
@@ -204,7 +204,7 @@ checkMultiOsAccountEnabled(): Promise<boolean>
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
try
{
try
{
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
...
@@ -245,7 +245,7 @@ checkOsAccountActivated(localId: number, callback: AsyncCallback<boolean>)
...
@@ -245,7 +245,7 @@ checkOsAccountActivated(localId: number, callback: AsyncCallback<boolean>)
**示例:**
判断ID为100的系统帐号是否处于激活状态
**示例:**
判断ID为100的系统帐号是否处于激活状态
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
localId
:
number
=
100
;
let
localId
:
number
=
100
;
...
@@ -294,7 +294,7 @@ checkOsAccountActivated(localId: number): Promise<boolean>
...
@@ -294,7 +294,7 @@ checkOsAccountActivated(localId: number): Promise<boolean>
**示例:**
判断ID为100的系统帐号是否处于激活状态
**示例:**
判断ID为100的系统帐号是否处于激活状态
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
localId
:
number
=
100
;
let
localId
:
number
=
100
;
...
@@ -337,7 +337,7 @@ checkOsAccountConstraintEnabled(localId: number, constraint: string, callback: A
...
@@ -337,7 +337,7 @@ checkOsAccountConstraintEnabled(localId: number, constraint: string, callback: A
**示例:**
判断ID为100的系统帐号是否有禁止使用Wi-Fi的约束
**示例:**
判断ID为100的系统帐号是否有禁止使用Wi-Fi的约束
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
localId
:
number
=
100
;
let
localId
:
number
=
100
;
...
@@ -388,7 +388,7 @@ checkOsAccountConstraintEnabled(localId: number, constraint: string): Promise<
...
@@ -388,7 +388,7 @@ checkOsAccountConstraintEnabled(localId: number, constraint: string): Promise<
**示例:**
判断ID为100的系统帐号是否有禁止使用Wi-Fi的约束
**示例:**
判断ID为100的系统帐号是否有禁止使用Wi-Fi的约束
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
localId
:
number
=
100
;
let
localId
:
number
=
100
;
...
@@ -426,7 +426,7 @@ checkOsAccountTestable(callback: AsyncCallback<boolean>): void
...
@@ -426,7 +426,7 @@ checkOsAccountTestable(callback: AsyncCallback<boolean>): void
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
try
{
try
{
...
@@ -464,7 +464,7 @@ checkOsAccountTestable(): Promise<boolean>
...
@@ -464,7 +464,7 @@ checkOsAccountTestable(): Promise<boolean>
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
try
{
try
{
...
@@ -500,7 +500,7 @@ checkOsAccountVerified(callback: AsyncCallback<boolean>): void
...
@@ -500,7 +500,7 @@ checkOsAccountVerified(callback: AsyncCallback<boolean>): void
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
try
{
try
{
...
@@ -538,7 +538,7 @@ checkOsAccountVerified(): Promise<boolean>
...
@@ -538,7 +538,7 @@ checkOsAccountVerified(): Promise<boolean>
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
try
{
try
{
...
@@ -579,7 +579,7 @@ checkOsAccountVerified(localId: number, callback: AsyncCallback<boolean>):
...
@@ -579,7 +579,7 @@ checkOsAccountVerified(localId: number, callback: AsyncCallback<boolean>):
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
localId
:
number
=
100
;
let
localId
:
number
=
100
;
...
@@ -628,7 +628,7 @@ checkOsAccountVerified(localId: number): Promise<boolean>
...
@@ -628,7 +628,7 @@ checkOsAccountVerified(localId: number): Promise<boolean>
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
localId
:
number
=
100
;
let
localId
:
number
=
100
;
...
@@ -665,7 +665,7 @@ checkOsAccountVerified(): Promise<boolean>
...
@@ -665,7 +665,7 @@ checkOsAccountVerified(): Promise<boolean>
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
try
{
try
{
...
@@ -709,7 +709,7 @@ removeOsAccount(localId: number, callback: AsyncCallback<void>): void
...
@@ -709,7 +709,7 @@ removeOsAccount(localId: number, callback: AsyncCallback<void>): void
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountName
:
string
=
'
testAccountName
'
;
let
accountName
:
string
=
'
testAccountName
'
;
...
@@ -764,7 +764,7 @@ removeOsAccount(localId: number): Promise<void>
...
@@ -764,7 +764,7 @@ removeOsAccount(localId: number): Promise<void>
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountName
:
string
=
'
testAccountName
'
;
let
accountName
:
string
=
'
testAccountName
'
;
...
@@ -814,7 +814,7 @@ setOsAccountConstraints(localId: number, constraints: Array<string>, enabl
...
@@ -814,7 +814,7 @@ setOsAccountConstraints(localId: number, constraints: Array<string>, enabl
**示例:**
给ID为100的系统帐号设置禁止使用Wi-Fi的约束
**示例:**
给ID为100的系统帐号设置禁止使用Wi-Fi的约束
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
localId
:
number
=
100
;
let
localId
:
number
=
100
;
...
@@ -869,7 +869,7 @@ setOsAccountConstraints(localId: number, constraints: Array<string>, enabl
...
@@ -869,7 +869,7 @@ setOsAccountConstraints(localId: number, constraints: Array<string>, enabl
**示例:**
删除ID为100的系统帐号的禁止使用Wi-Fi的约束
**示例:**
删除ID为100的系统帐号的禁止使用Wi-Fi的约束
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
localId
:
number
=
100
;
let
localId
:
number
=
100
;
...
@@ -915,7 +915,7 @@ setOsAccountName(localId: number, localName: string, callback: AsyncCallback<
...
@@ -915,7 +915,7 @@ setOsAccountName(localId: number, localName: string, callback: AsyncCallback<
**示例:**
将ID为100的系统帐号的帐号名设置成demoName
**示例:**
将ID为100的系统帐号的帐号名设置成demoName
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
localId
:
number
=
100
;
let
localId
:
number
=
100
;
...
@@ -969,7 +969,7 @@ setOsAccountName(localId: number, localName: string): Promise<void>
...
@@ -969,7 +969,7 @@ setOsAccountName(localId: number, localName: string): Promise<void>
**示例:**
将ID为100的系统帐号的帐号名设置成demoName
**示例:**
将ID为100的系统帐号的帐号名设置成demoName
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
localId
:
number
=
100
;
let
localId
:
number
=
100
;
...
@@ -1009,7 +1009,7 @@ getOsAccountCount(callback: AsyncCallback<number>): void
...
@@ -1009,7 +1009,7 @@ getOsAccountCount(callback: AsyncCallback<number>): void
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
try
{
try
{
...
@@ -1049,7 +1049,7 @@ getOsAccountCount(): Promise<number>
...
@@ -1049,7 +1049,7 @@ getOsAccountCount(): Promise<number>
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
try
{
try
{
...
@@ -1085,7 +1085,7 @@ getOsAccountLocalId(callback: AsyncCallback<number>): void
...
@@ -1085,7 +1085,7 @@ getOsAccountLocalId(callback: AsyncCallback<number>): void
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
try
{
try
{
...
@@ -1123,7 +1123,7 @@ getOsAccountLocalId(): Promise<number>
...
@@ -1123,7 +1123,7 @@ getOsAccountLocalId(): Promise<number>
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
try
{
try
{
...
@@ -1161,7 +1161,7 @@ getOsAccountLocalIdForUid(uid: number, callback: AsyncCallback<number>): v
...
@@ -1161,7 +1161,7 @@ getOsAccountLocalIdForUid(uid: number, callback: AsyncCallback<number>): v
**示例:**
查询值为12345678的uid所属的系统帐号的帐号ID
**示例:**
查询值为12345678的uid所属的系统帐号的帐号ID
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
uid
:
number
=
12345678
;
let
uid
:
number
=
12345678
;
...
@@ -1206,7 +1206,7 @@ getOsAccountLocalIdForUid(uid: number): Promise<number>
...
@@ -1206,7 +1206,7 @@ getOsAccountLocalIdForUid(uid: number): Promise<number>
**示例:**
查询值为12345678的uid所属的系统帐号ID
**示例:**
查询值为12345678的uid所属的系统帐号ID
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
uid
:
number
=
12345678
;
let
uid
:
number
=
12345678
;
...
@@ -1247,7 +1247,7 @@ getOsAccountLocalIdForDomain(domainInfo: DomainAccountInfo, callback: AsyncCallb
...
@@ -1247,7 +1247,7 @@ getOsAccountLocalIdForDomain(domainInfo: DomainAccountInfo, callback: AsyncCallb
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
domainInfo
:
account_osAccount
.
DomainAccountInfo
=
{
domain
:
'
testDomain
'
,
accountName
:
'
testAccountName
'
};
let
domainInfo
:
account_osAccount
.
DomainAccountInfo
=
{
domain
:
'
testDomain
'
,
accountName
:
'
testAccountName
'
};
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
...
@@ -1295,7 +1295,7 @@ getOsAccountLocalIdForDomain(domainInfo: DomainAccountInfo): Promise<number&g
...
@@ -1295,7 +1295,7 @@ getOsAccountLocalIdForDomain(domainInfo: DomainAccountInfo): Promise<number&g
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
domainInfo
:
account_osAccount
.
DomainAccountInfo
=
{
domain
:
'
testDomain
'
,
accountName
:
'
testAccountName
'
};
let
domainInfo
:
account_osAccount
.
DomainAccountInfo
=
{
domain
:
'
testDomain
'
,
accountName
:
'
testAccountName
'
};
...
@@ -1334,7 +1334,7 @@ queryMaxOsAccountNumber(callback: AsyncCallback<number>): void
...
@@ -1334,7 +1334,7 @@ queryMaxOsAccountNumber(callback: AsyncCallback<number>): void
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
try
{
try
{
...
@@ -1374,7 +1374,7 @@ queryMaxOsAccountNumber(): Promise<number>
...
@@ -1374,7 +1374,7 @@ queryMaxOsAccountNumber(): Promise<number>
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
try
{
try
{
...
@@ -1415,7 +1415,7 @@ getOsAccountConstraints(localId: number, callback: AsyncCallback<Array<str
...
@@ -1415,7 +1415,7 @@ getOsAccountConstraints(localId: number, callback: AsyncCallback<Array<str
**示例:**
获取ID为100的系统帐号的全部约束
**示例:**
获取ID为100的系统帐号的全部约束
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
localId
:
number
=
100
;
let
localId
:
number
=
100
;
...
@@ -1464,7 +1464,7 @@ getOsAccountConstraints(localId: number): Promise<Array<string>>
...
@@ -1464,7 +1464,7 @@ getOsAccountConstraints(localId: number): Promise<Array<string>>
**示例:**
获取ID为100的系统帐号的全部约束
**示例:**
获取ID为100的系统帐号的全部约束
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
localId
:
number
=
100
;
let
localId
:
number
=
100
;
...
@@ -1505,7 +1505,7 @@ queryAllCreatedOsAccounts(callback: AsyncCallback<Array<OsAccountInfo>&
...
@@ -1505,7 +1505,7 @@ queryAllCreatedOsAccounts(callback: AsyncCallback<Array<OsAccountInfo>&
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
try
{
try
{
...
@@ -1544,7 +1544,7 @@ queryAllCreatedOsAccounts(): Promise<Array<OsAccountInfo>>
...
@@ -1544,7 +1544,7 @@ queryAllCreatedOsAccounts(): Promise<Array<OsAccountInfo>>
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
try
{
try
{
...
@@ -1580,7 +1580,7 @@ getActivatedOsAccountLocalIds(callback: AsyncCallback<Array<number>>
...
@@ -1580,7 +1580,7 @@ getActivatedOsAccountLocalIds(callback: AsyncCallback<Array<number>>
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
try
{
try
{
...
@@ -1618,7 +1618,7 @@ getActivatedOsAccountLocalIds(): Promise<Array<number>>
...
@@ -1618,7 +1618,7 @@ getActivatedOsAccountLocalIds(): Promise<Array<number>>
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
try
{
try
{
...
@@ -1664,7 +1664,7 @@ createOsAccount(localName: string, type: OsAccountType, callback: AsyncCallback&
...
@@ -1664,7 +1664,7 @@ createOsAccount(localName: string, type: OsAccountType, callback: AsyncCallback&
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
try
{
try
{
...
@@ -1715,7 +1715,7 @@ createOsAccount(localName: string, type: OsAccountType): Promise<OsAccountInf
...
@@ -1715,7 +1715,7 @@ createOsAccount(localName: string, type: OsAccountType): Promise<OsAccountInf
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
try
{
try
{
...
@@ -1762,7 +1762,7 @@ createOsAccountForDomain(type: OsAccountType, domainInfo: DomainAccountInfo, cal
...
@@ -1762,7 +1762,7 @@ createOsAccountForDomain(type: OsAccountType, domainInfo: DomainAccountInfo, cal
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
domainInfo
:
account_osAccount
.
DomainAccountInfo
=
let
domainInfo
:
account_osAccount
.
DomainAccountInfo
=
...
@@ -1815,7 +1815,7 @@ createOsAccountForDomain(type: OsAccountType, domainInfo: DomainAccountInfo): Pr
...
@@ -1815,7 +1815,7 @@ createOsAccountForDomain(type: OsAccountType, domainInfo: DomainAccountInfo): Pr
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
domainInfo
:
account_osAccount
.
DomainAccountInfo
=
let
domainInfo
:
account_osAccount
.
DomainAccountInfo
=
...
@@ -1856,7 +1856,7 @@ getCurrentOsAccount(callback: AsyncCallback<OsAccountInfo>): void
...
@@ -1856,7 +1856,7 @@ getCurrentOsAccount(callback: AsyncCallback<OsAccountInfo>): void
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
try
{
try
{
...
@@ -1893,7 +1893,7 @@ getCurrentOsAccount(): Promise<OsAccountInfo>
...
@@ -1893,7 +1893,7 @@ getCurrentOsAccount(): Promise<OsAccountInfo>
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
try
{
try
{
...
@@ -1936,7 +1936,7 @@ queryOsAccountById(localId: number, callback: AsyncCallback<OsAccountInfo>
...
@@ -1936,7 +1936,7 @@ queryOsAccountById(localId: number, callback: AsyncCallback<OsAccountInfo>
**示例:**
查询ID为100的系统帐号信息
**示例:**
查询ID为100的系统帐号信息
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
localId
:
number
=
100
;
let
localId
:
number
=
100
;
...
@@ -1984,7 +1984,7 @@ queryOsAccountById(localId: number): Promise<OsAccountInfo>
...
@@ -1984,7 +1984,7 @@ queryOsAccountById(localId: number): Promise<OsAccountInfo>
**示例:**
查询ID为100的系统帐号信息
**示例:**
查询ID为100的系统帐号信息
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
localId
:
number
=
100
;
let
localId
:
number
=
100
;
...
@@ -2021,7 +2021,7 @@ getOsAccountType(callback: AsyncCallback<OsAccountType>): void
...
@@ -2021,7 +2021,7 @@ getOsAccountType(callback: AsyncCallback<OsAccountType>): void
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
try
{
try
{
...
@@ -2056,7 +2056,7 @@ getOsAccountType(): Promise<OsAccountType>
...
@@ -2056,7 +2056,7 @@ getOsAccountType(): Promise<OsAccountType>
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
try
{
try
{
...
@@ -2094,7 +2094,7 @@ queryDistributedVirtualDeviceId(callback: AsyncCallback<string>): void
...
@@ -2094,7 +2094,7 @@ queryDistributedVirtualDeviceId(callback: AsyncCallback<string>): void
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
try
{
try
{
...
@@ -2131,7 +2131,7 @@ queryDistributedVirtualDeviceId(): Promise<string>
...
@@ -2131,7 +2131,7 @@ queryDistributedVirtualDeviceId(): Promise<string>
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
try
{
try
{
...
@@ -2174,7 +2174,7 @@ getOsAccountProfilePhoto(localId: number, callback: AsyncCallback<string>)
...
@@ -2174,7 +2174,7 @@ getOsAccountProfilePhoto(localId: number, callback: AsyncCallback<string>)
**示例:**
获取ID为100的系统帐号的头像
**示例:**
获取ID为100的系统帐号的头像
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
localId
:
number
=
100
;
let
localId
:
number
=
100
;
...
@@ -2222,7 +2222,7 @@ getOsAccountProfilePhoto(localId: number): Promise<string>
...
@@ -2222,7 +2222,7 @@ getOsAccountProfilePhoto(localId: number): Promise<string>
**示例:**
获取ID为100的系统帐号的头像
**示例:**
获取ID为100的系统帐号的头像
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
localId
:
number
=
100
;
let
localId
:
number
=
100
;
...
@@ -2268,7 +2268,7 @@ setOsAccountProfilePhoto(localId: number, photo: string, callback: AsyncCallback
...
@@ -2268,7 +2268,7 @@ setOsAccountProfilePhoto(localId: number, photo: string, callback: AsyncCallback
**示例:**
给ID为100的系统帐号设置头像
**示例:**
给ID为100的系统帐号设置头像
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
localId
:
number
=
100
;
let
localId
:
number
=
100
;
...
@@ -2321,7 +2321,7 @@ setOsAccountProfilePhoto(localId: number, photo: string): Promise<void>
...
@@ -2321,7 +2321,7 @@ setOsAccountProfilePhoto(localId: number, photo: string): Promise<void>
**示例:**
给ID为100的系统帐号设置头像
**示例:**
给ID为100的系统帐号设置头像
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
localId
:
number
=
100
;
let
localId
:
number
=
100
;
...
@@ -2365,7 +2365,7 @@ getOsAccountLocalIdForSerialNumber(serialNumber: number, callback: AsyncCallback
...
@@ -2365,7 +2365,7 @@ getOsAccountLocalIdForSerialNumber(serialNumber: number, callback: AsyncCallback
**示例:**
查询与SN码12345关联的系统帐号的ID
**示例:**
查询与SN码12345关联的系统帐号的ID
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
serialNumber
:
number
=
12345
;
let
serialNumber
:
number
=
12345
;
...
@@ -2409,7 +2409,7 @@ getOsAccountLocalIdForSerialNumber(serialNumber: number): Promise<number>
...
@@ -2409,7 +2409,7 @@ getOsAccountLocalIdForSerialNumber(serialNumber: number): Promise<number>
**示例:**
查询与SN码12345关联的系统帐号的ID
**示例:**
查询与SN码12345关联的系统帐号的ID
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
serialNumber
:
number
=
12345
;
let
serialNumber
:
number
=
12345
;
...
@@ -2449,7 +2449,7 @@ getSerialNumberForOsAccountLocalId(localId: number, callback: AsyncCallback<n
...
@@ -2449,7 +2449,7 @@ getSerialNumberForOsAccountLocalId(localId: number, callback: AsyncCallback<n
**示例:**
获取ID为100的系统帐号关联的SN码
**示例:**
获取ID为100的系统帐号关联的SN码
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
localId
:
number
=
100
;
let
localId
:
number
=
100
;
...
@@ -2493,7 +2493,7 @@ getSerialNumberForOsAccountLocalId(localId: number): Promise<number>
...
@@ -2493,7 +2493,7 @@ getSerialNumberForOsAccountLocalId(localId: number): Promise<number>
**示例:**
获取ID为100的系统帐号关联的SN码
**示例:**
获取ID为100的系统帐号关联的SN码
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
localId
:
number
=
100
;
let
localId
:
number
=
100
;
...
@@ -2537,7 +2537,7 @@ on(type: 'activate' | 'activating', name: string, callback: Callback<number&g
...
@@ -2537,7 +2537,7 @@ on(type: 'activate' | 'activating', name: string, callback: Callback<number&g
**示例:**
**示例:**
```
j
s
```
t
s
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
function
onCallback
(
receiveLocalId
:
number
){
function
onCallback
(
receiveLocalId
:
number
){
console
.
log
(
'
receive localId:
'
+
receiveLocalId
);
console
.
log
(
'
receive localId:
'
+
receiveLocalId
);
...
@@ -2578,7 +2578,7 @@ off(type: 'activate' | 'activating', name: string, callback?: Callback<number
...
@@ -2578,7 +2578,7 @@ off(type: 'activate' | 'activating', name: string, callback?: Callback<number
**示例:**
**示例:**
```
j
s
```
t
s
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
function
offCallback
(){
function
offCallback
(){
console
.
log
(
'
off enter
'
)
console
.
log
(
'
off enter
'
)
...
@@ -2616,7 +2616,7 @@ getBundleIdForUid(uid: number, callback: AsyncCallback<number>): void;
...
@@ -2616,7 +2616,7 @@ getBundleIdForUid(uid: number, callback: AsyncCallback<number>): void;
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
testUid
:
number
=
1000000
;
let
testUid
:
number
=
1000000
;
...
@@ -2660,7 +2660,7 @@ getBundleIdForUid(uid: number): Promise<number>;
...
@@ -2660,7 +2660,7 @@ getBundleIdForUid(uid: number): Promise<number>;
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
testUid
:
number
=
1000000
;
let
testUid
:
number
=
1000000
;
...
@@ -2701,7 +2701,7 @@ isMainOsAccount(callback: AsyncCallback<boolean>): void;
...
@@ -2701,7 +2701,7 @@ isMainOsAccount(callback: AsyncCallback<boolean>): void;
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
try
{
try
{
...
@@ -2739,7 +2739,7 @@ isMainOsAccount(): Promise<boolean>;
...
@@ -2739,7 +2739,7 @@ isMainOsAccount(): Promise<boolean>;
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
try
{
try
{
...
@@ -2782,7 +2782,7 @@ getOsAccountConstraintSourceTypes(localId: number, constraint: string, callback:
...
@@ -2782,7 +2782,7 @@ getOsAccountConstraintSourceTypes(localId: number, constraint: string, callback:
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
try
{
try
{
...
@@ -2831,7 +2831,7 @@ getOsAccountConstraintSourceTypes(localId: number, constraint: string): Promise&
...
@@ -2831,7 +2831,7 @@ getOsAccountConstraintSourceTypes(localId: number, constraint: string): Promise&
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
try
{
try
{
...
@@ -2866,7 +2866,7 @@ isMultiOsAccountEnable(callback: AsyncCallback<boolean>): void
...
@@ -2866,7 +2866,7 @@ isMultiOsAccountEnable(callback: AsyncCallback<boolean>): void
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
accountManager
.
isMultiOsAccountEnable
((
err
:
BusinessError
,
isEnabled
:
boolean
)
=>
{
accountManager
.
isMultiOsAccountEnable
((
err
:
BusinessError
,
isEnabled
:
boolean
)
=>
{
...
@@ -2898,7 +2898,7 @@ isMultiOsAccountEnable(): Promise<boolean>
...
@@ -2898,7 +2898,7 @@ isMultiOsAccountEnable(): Promise<boolean>
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
accountManager
.
isMultiOsAccountEnable
().
then
((
isEnabled
:
boolean
)
=>
{
accountManager
.
isMultiOsAccountEnable
().
then
((
isEnabled
:
boolean
)
=>
{
...
@@ -2932,7 +2932,7 @@ isOsAccountActived(localId: number, callback: AsyncCallback<boolean>): voi
...
@@ -2932,7 +2932,7 @@ isOsAccountActived(localId: number, callback: AsyncCallback<boolean>): voi
**示例:**
判断ID为100的系统帐号是否处于激活状态
**示例:**
判断ID为100的系统帐号是否处于激活状态
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
localId
:
number
=
100
;
let
localId
:
number
=
100
;
...
@@ -2973,7 +2973,7 @@ isOsAccountActived(localId: number): Promise<boolean>
...
@@ -2973,7 +2973,7 @@ isOsAccountActived(localId: number): Promise<boolean>
**示例:**
判断ID为100的系统帐号是否处于激活状态
**示例:**
判断ID为100的系统帐号是否处于激活状态
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
localId
:
number
=
100
;
let
localId
:
number
=
100
;
...
@@ -3008,7 +3008,7 @@ isOsAccountConstraintEnable(localId: number, constraint: string, callback: Async
...
@@ -3008,7 +3008,7 @@ isOsAccountConstraintEnable(localId: number, constraint: string, callback: Async
**示例:**
判断ID为100的系统帐号是否有禁止使用Wi-Fi的约束
**示例:**
判断ID为100的系统帐号是否有禁止使用Wi-Fi的约束
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
localId
:
number
=
100
;
let
localId
:
number
=
100
;
...
@@ -3051,7 +3051,7 @@ isOsAccountConstraintEnable(localId: number, constraint: string): Promise<boo
...
@@ -3051,7 +3051,7 @@ isOsAccountConstraintEnable(localId: number, constraint: string): Promise<boo
**示例:**
判断ID为100的系统帐号是否有禁止使用Wi-Fi的约束
**示例:**
判断ID为100的系统帐号是否有禁止使用Wi-Fi的约束
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
localId
:
number
=
100
;
let
localId
:
number
=
100
;
...
@@ -3083,7 +3083,7 @@ isTestOsAccount(callback: AsyncCallback<boolean>): void
...
@@ -3083,7 +3083,7 @@ isTestOsAccount(callback: AsyncCallback<boolean>): void
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
accountManager
.
isTestOsAccount
((
err
:
BusinessError
,
isTestable
:
boolean
)
=>
{
accountManager
.
isTestOsAccount
((
err
:
BusinessError
,
isTestable
:
boolean
)
=>
{
...
@@ -3115,7 +3115,7 @@ isTestOsAccount(): Promise<boolean>
...
@@ -3115,7 +3115,7 @@ isTestOsAccount(): Promise<boolean>
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
accountManager
.
isTestOsAccount
().
then
((
isTestable
:
boolean
)
=>
{
accountManager
.
isTestOsAccount
().
then
((
isTestable
:
boolean
)
=>
{
...
@@ -3147,7 +3147,7 @@ isOsAccountVerified(callback: AsyncCallback<boolean>): void
...
@@ -3147,7 +3147,7 @@ isOsAccountVerified(callback: AsyncCallback<boolean>): void
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
accountManager
.
isOsAccountVerified
((
err
:
BusinessError
,
isVerified
:
boolean
)
=>
{
accountManager
.
isOsAccountVerified
((
err
:
BusinessError
,
isVerified
:
boolean
)
=>
{
...
@@ -3182,7 +3182,7 @@ isOsAccountVerified(localId: number, callback: AsyncCallback<boolean>): vo
...
@@ -3182,7 +3182,7 @@ isOsAccountVerified(localId: number, callback: AsyncCallback<boolean>): vo
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
localId
:
number
=
100
;
let
localId
:
number
=
100
;
...
@@ -3223,7 +3223,7 @@ isOsAccountVerified(localId?: number): Promise<boolean>
...
@@ -3223,7 +3223,7 @@ isOsAccountVerified(localId?: number): Promise<boolean>
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
accountManager
.
isOsAccountVerified
(
localId
).
then
((
isVerified
:
boolean
)
=>
{
accountManager
.
isOsAccountVerified
(
localId
).
then
((
isVerified
:
boolean
)
=>
{
...
@@ -3255,7 +3255,7 @@ getCreatedOsAccountsCount(callback: AsyncCallback<number>): void
...
@@ -3255,7 +3255,7 @@ getCreatedOsAccountsCount(callback: AsyncCallback<number>): void
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
accountManager
.
getCreatedOsAccountsCount
((
err
:
BusinessError
,
count
:
number
)
=>
{
accountManager
.
getCreatedOsAccountsCount
((
err
:
BusinessError
,
count
:
number
)
=>
{
...
@@ -3289,7 +3289,7 @@ getCreatedOsAccountsCount(): Promise<number>
...
@@ -3289,7 +3289,7 @@ getCreatedOsAccountsCount(): Promise<number>
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
accountManager
.
getCreatedOsAccountsCount
().
then
((
count
:
number
)
=>
{
accountManager
.
getCreatedOsAccountsCount
().
then
((
count
:
number
)
=>
{
...
@@ -3319,7 +3319,7 @@ getOsAccountLocalIdFromProcess(callback: AsyncCallback<number>): void
...
@@ -3319,7 +3319,7 @@ getOsAccountLocalIdFromProcess(callback: AsyncCallback<number>): void
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
accountManager
.
getOsAccountLocalIdFromProcess
((
err
:
BusinessError
,
localId
:
number
)
=>
{
accountManager
.
getOsAccountLocalIdFromProcess
((
err
:
BusinessError
,
localId
:
number
)
=>
{
...
@@ -3351,7 +3351,7 @@ getOsAccountLocalIdFromProcess(): Promise<number>
...
@@ -3351,7 +3351,7 @@ getOsAccountLocalIdFromProcess(): Promise<number>
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
accountManager
.
getOsAccountLocalIdFromProcess
().
then
((
localId
:
number
)
=>
{
accountManager
.
getOsAccountLocalIdFromProcess
().
then
((
localId
:
number
)
=>
{
...
@@ -3382,7 +3382,7 @@ getOsAccountLocalIdFromUid(uid: number, callback: AsyncCallback<number>):
...
@@ -3382,7 +3382,7 @@ getOsAccountLocalIdFromUid(uid: number, callback: AsyncCallback<number>):
**示例:**
查询值为12345678的uid所属的系统帐号ID
**示例:**
查询值为12345678的uid所属的系统帐号ID
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
uid
:
number
=
12345678
;
let
uid
:
number
=
12345678
;
...
@@ -3421,7 +3421,7 @@ getOsAccountLocalIdFromUid(uid: number): Promise<number>
...
@@ -3421,7 +3421,7 @@ getOsAccountLocalIdFromUid(uid: number): Promise<number>
**示例:**
查询值为12345678的uid所属的系统帐号ID
**示例:**
查询值为12345678的uid所属的系统帐号ID
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
uid
:
number
=
12345678
;
let
uid
:
number
=
12345678
;
...
@@ -3455,7 +3455,7 @@ getOsAccountLocalIdFromDomain(domainInfo: DomainAccountInfo, callback: AsyncCall
...
@@ -3455,7 +3455,7 @@ getOsAccountLocalIdFromDomain(domainInfo: DomainAccountInfo, callback: AsyncCall
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
domainInfo
=
{
domain
:
'
testDomain
'
,
accountName
:
'
testAccountName
'
};
let
domainInfo
=
{
domain
:
'
testDomain
'
,
accountName
:
'
testAccountName
'
};
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
...
@@ -3496,7 +3496,7 @@ getOsAccountLocalIdFromDomain(domainInfo: DomainAccountInfo): Promise<number&
...
@@ -3496,7 +3496,7 @@ getOsAccountLocalIdFromDomain(domainInfo: DomainAccountInfo): Promise<number&
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
domainInfo
=
{
domain
:
'
testDomain
'
,
accountName
:
'
testAccountName
'
};
let
domainInfo
=
{
domain
:
'
testDomain
'
,
accountName
:
'
testAccountName
'
};
...
@@ -3530,7 +3530,7 @@ getOsAccountAllConstraints(localId: number, callback: AsyncCallback<Array<
...
@@ -3530,7 +3530,7 @@ getOsAccountAllConstraints(localId: number, callback: AsyncCallback<Array<
**示例:**
获取ID为100的系统帐号的全部约束
**示例:**
获取ID为100的系统帐号的全部约束
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
localId
:
number
=
100
;
let
localId
:
number
=
100
;
...
@@ -3568,7 +3568,7 @@ getOsAccountAllConstraints(localId: number): Promise<Array<string>>
...
@@ -3568,7 +3568,7 @@ getOsAccountAllConstraints(localId: number): Promise<Array<string>>
**示例:**
获取ID为100的系统帐号的全部约束
**示例:**
获取ID为100的系统帐号的全部约束
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
localId
:
number
=
100
;
let
localId
:
number
=
100
;
...
@@ -3599,7 +3599,7 @@ queryActivatedOsAccountIds(callback: AsyncCallback<Array<number>>):
...
@@ -3599,7 +3599,7 @@ queryActivatedOsAccountIds(callback: AsyncCallback<Array<number>>):
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
accountManager
.
queryActivatedOsAccountIds
((
err
:
BusinessError
,
idArray
:
number
[])
=>
{
accountManager
.
queryActivatedOsAccountIds
((
err
:
BusinessError
,
idArray
:
number
[])
=>
{
...
@@ -3631,7 +3631,7 @@ queryActivatedOsAccountIds(): Promise<Array<number>>
...
@@ -3631,7 +3631,7 @@ queryActivatedOsAccountIds(): Promise<Array<number>>
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
accountManager
.
queryActivatedOsAccountIds
().
then
((
idArray
:
number
[])
=>
{
accountManager
.
queryActivatedOsAccountIds
().
then
((
idArray
:
number
[])
=>
{
...
@@ -3663,7 +3663,7 @@ queryCurrentOsAccount(callback: AsyncCallback<OsAccountInfo>): void
...
@@ -3663,7 +3663,7 @@ queryCurrentOsAccount(callback: AsyncCallback<OsAccountInfo>): void
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
accountManager
.
queryCurrentOsAccount
((
err
:
BusinessError
,
curAccountInfo
:
account_osAccount
.
OsAccountInfo
)
=>
{
accountManager
.
queryCurrentOsAccount
((
err
:
BusinessError
,
curAccountInfo
:
account_osAccount
.
OsAccountInfo
)
=>
{
...
@@ -3694,7 +3694,7 @@ queryCurrentOsAccount(): Promise<OsAccountInfo>
...
@@ -3694,7 +3694,7 @@ queryCurrentOsAccount(): Promise<OsAccountInfo>
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
accountManager
.
queryCurrentOsAccount
().
then
((
accountInfo
:
account_osAccount
.
OsAccountInfo
)
=>
{
accountManager
.
queryCurrentOsAccount
().
then
((
accountInfo
:
account_osAccount
.
OsAccountInfo
)
=>
{
...
@@ -3724,7 +3724,7 @@ getOsAccountTypeFromProcess(callback: AsyncCallback<OsAccountType>): void
...
@@ -3724,7 +3724,7 @@ getOsAccountTypeFromProcess(callback: AsyncCallback<OsAccountType>): void
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
accountManager
.
getOsAccountTypeFromProcess
((
err
:
BusinessError
,
accountType
:
account_osAccount
.
OsAccountType
)
=>
{
accountManager
.
getOsAccountTypeFromProcess
((
err
:
BusinessError
,
accountType
:
account_osAccount
.
OsAccountType
)
=>
{
...
@@ -3753,7 +3753,7 @@ getOsAccountTypeFromProcess(): Promise<OsAccountType>
...
@@ -3753,7 +3753,7 @@ getOsAccountTypeFromProcess(): Promise<OsAccountType>
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
accountManager
.
getOsAccountTypeFromProcess
().
then
((
accountType
:
account_osAccount
.
OsAccountType
)
=>
{
accountManager
.
getOsAccountTypeFromProcess
().
then
((
accountType
:
account_osAccount
.
OsAccountType
)
=>
{
...
@@ -3785,7 +3785,7 @@ getDistributedVirtualDeviceId(callback: AsyncCallback<string>): void
...
@@ -3785,7 +3785,7 @@ getDistributedVirtualDeviceId(callback: AsyncCallback<string>): void
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
accountManager
.
getDistributedVirtualDeviceId
((
err
:
BusinessError
,
virtualID
:
string
)
=>
{
accountManager
.
getDistributedVirtualDeviceId
((
err
:
BusinessError
,
virtualID
:
string
)
=>
{
...
@@ -3816,7 +3816,7 @@ getDistributedVirtualDeviceId(): Promise<string>
...
@@ -3816,7 +3816,7 @@ getDistributedVirtualDeviceId(): Promise<string>
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
accountManager
.
getDistributedVirtualDeviceId
().
then
((
virtualID
:
string
)
=>
{
accountManager
.
getDistributedVirtualDeviceId
().
then
((
virtualID
:
string
)
=>
{
...
@@ -3847,7 +3847,7 @@ getOsAccountLocalIdBySerialNumber(serialNumber: number, callback: AsyncCallback&
...
@@ -3847,7 +3847,7 @@ getOsAccountLocalIdBySerialNumber(serialNumber: number, callback: AsyncCallback&
**示例:**
查询与SN码12345关联的系统帐号的ID
**示例:**
查询与SN码12345关联的系统帐号的ID
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
serialNumber
:
number
=
12345
;
let
serialNumber
:
number
=
12345
;
...
@@ -3883,7 +3883,7 @@ getOsAccountLocalIdBySerialNumber(serialNumber: number): Promise<number>
...
@@ -3883,7 +3883,7 @@ getOsAccountLocalIdBySerialNumber(serialNumber: number): Promise<number>
**示例:**
查询与SN码12345关联的系统帐号的ID
**示例:**
查询与SN码12345关联的系统帐号的ID
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
serialNumber
:
number
=
12345
;
let
serialNumber
:
number
=
12345
;
...
@@ -3915,7 +3915,7 @@ getSerialNumberByOsAccountLocalId(localId: number, callback: AsyncCallback<nu
...
@@ -3915,7 +3915,7 @@ getSerialNumberByOsAccountLocalId(localId: number, callback: AsyncCallback<nu
**示例:**
获取ID为100的系统帐号关联的SN码
**示例:**
获取ID为100的系统帐号关联的SN码
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
localId
:
number
=
100
;
let
localId
:
number
=
100
;
...
@@ -3951,7 +3951,7 @@ getSerialNumberByOsAccountLocalId(localId: number): Promise<number>
...
@@ -3951,7 +3951,7 @@ getSerialNumberByOsAccountLocalId(localId: number): Promise<number>
**示例:**
获取ID为100的系统帐号关联的SN码
**示例:**
获取ID为100的系统帐号关联的SN码
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
localId
:
number
=
100
;
let
localId
:
number
=
100
;
...
@@ -3979,7 +3979,7 @@ constructor()
...
@@ -3979,7 +3979,7 @@ constructor()
**系统能力**
:SystemCapability.Account.OsAccount
**系统能力**
:SystemCapability.Account.OsAccount
**示例:**
**示例:**
```
j
s
```
t
s
let
userAuth
=
new
account_osAccount
.
UserAuth
();
let
userAuth
=
new
account_osAccount
.
UserAuth
();
```
```
...
@@ -4000,7 +4000,7 @@ getVersion(): number;
...
@@ -4000,7 +4000,7 @@ getVersion(): number;
| number | 返回版本信息。|
| number | 返回版本信息。|
**示例:**
**示例:**
```
j
s
```
t
s
let
userAuth
=
new
account_osAccount
.
UserAuth
();
let
userAuth
=
new
account_osAccount
.
UserAuth
();
let
version
:
number
=
userAuth
.
getVersion
();
let
version
:
number
=
userAuth
.
getVersion
();
console
.
log
(
'
getVersion version =
'
+
version
);
console
.
log
(
'
getVersion version =
'
+
version
);
...
@@ -4039,7 +4039,7 @@ getAvailableStatus(authType: AuthType, authTrustLevel: AuthTrustLevel): number;
...
@@ -4039,7 +4039,7 @@ getAvailableStatus(authType: AuthType, authTrustLevel: AuthTrustLevel): number;
| 12300002 | Invalid authType or authTrustLevel. |
| 12300002 | Invalid authType or authTrustLevel. |
**示例:**
**示例:**
```
j
s
```
t
s
let
userAuth
=
new
account_osAccount
.
UserAuth
();
let
userAuth
=
new
account_osAccount
.
UserAuth
();
let
authType
=
account_osAccount
.
AuthType
.
PIN
;
let
authType
=
account_osAccount
.
AuthType
.
PIN
;
let
authTrustLevel
=
account_osAccount
.
AuthTrustLevel
.
ATL1
;
let
authTrustLevel
=
account_osAccount
.
AuthTrustLevel
.
ATL1
;
...
@@ -4078,7 +4078,7 @@ getProperty(request: GetPropertyRequest, callback: AsyncCallback<ExecutorProp
...
@@ -4078,7 +4078,7 @@ getProperty(request: GetPropertyRequest, callback: AsyncCallback<ExecutorProp
| 12300002 | Invalid request. |
| 12300002 | Invalid request. |
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
userAuth
=
new
account_osAccount
.
UserAuth
();
let
userAuth
=
new
account_osAccount
.
UserAuth
();
let
keys
=
[
let
keys
=
[
...
@@ -4132,7 +4132,7 @@ getProperty(request: GetPropertyRequest): Promise<ExecutorProperty>;
...
@@ -4132,7 +4132,7 @@ getProperty(request: GetPropertyRequest): Promise<ExecutorProperty>;
| 12300002 | Invalid request. |
| 12300002 | Invalid request. |
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
userAuth
=
new
account_osAccount
.
UserAuth
();
let
userAuth
=
new
account_osAccount
.
UserAuth
();
let
keys
=
[
let
keys
=
[
...
@@ -4182,7 +4182,7 @@ setProperty(request: SetPropertyRequest, callback: AsyncCallback<void>): v
...
@@ -4182,7 +4182,7 @@ setProperty(request: SetPropertyRequest, callback: AsyncCallback<void>): v
| 12300002 | Invalid request. |
| 12300002 | Invalid request. |
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
userAuth
=
new
account_osAccount
.
UserAuth
();
let
userAuth
=
new
account_osAccount
.
UserAuth
();
let
request
:
account_osAccount
.
SetPropertyRequest
=
{
let
request
:
account_osAccount
.
SetPropertyRequest
=
{
...
@@ -4235,7 +4235,7 @@ setProperty(request: SetPropertyRequest): Promise<void>;
...
@@ -4235,7 +4235,7 @@ setProperty(request: SetPropertyRequest): Promise<void>;
| 12300002 | Invalid request. |
| 12300002 | Invalid request. |
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
userAuth
=
new
account_osAccount
.
UserAuth
();
let
userAuth
=
new
account_osAccount
.
UserAuth
();
let
request2
:
account_osAccount
.
SetPropertyRequest
=
{
let
request2
:
account_osAccount
.
SetPropertyRequest
=
{
...
@@ -4297,7 +4297,7 @@ auth(challenge: Uint8Array, authType: AuthType, authTrustLevel: AuthTrustLevel,
...
@@ -4297,7 +4297,7 @@ auth(challenge: Uint8Array, authType: AuthType, authTrustLevel: AuthTrustLevel,
| 12300112 | Authentication service is busy. |
| 12300112 | Authentication service is busy. |
**示例:**
**示例:**
```
j
s
```
t
s
let
userAuth
=
new
account_osAccount
.
UserAuth
();
let
userAuth
=
new
account_osAccount
.
UserAuth
();
let
challenge
=
new
Uint8Array
([
0
]);
let
challenge
=
new
Uint8Array
([
0
]);
let
authType
=
account_osAccount
.
AuthType
.
PIN
;
let
authType
=
account_osAccount
.
AuthType
.
PIN
;
...
@@ -4358,7 +4358,7 @@ authUser(userId: number, challenge: Uint8Array, authType: AuthType, authTrustLev
...
@@ -4358,7 +4358,7 @@ authUser(userId: number, challenge: Uint8Array, authType: AuthType, authTrustLev
| 12300112 | Authentication service is busy. |
| 12300112 | Authentication service is busy. |
**示例:**
**示例:**
```
j
s
```
t
s
let
userAuth
=
new
account_osAccount
.
UserAuth
();
let
userAuth
=
new
account_osAccount
.
UserAuth
();
let
userID
:
number
=
100
;
let
userID
:
number
=
100
;
let
challenge
=
new
Uint8Array
([
0
]);
let
challenge
=
new
Uint8Array
([
0
]);
...
@@ -4402,7 +4402,7 @@ cancelAuth(contextID: Uint8Array): void;
...
@@ -4402,7 +4402,7 @@ cancelAuth(contextID: Uint8Array): void;
| 12300002 | Invalid contextId. |
| 12300002 | Invalid contextId. |
**示例:**
**示例:**
```
j
s
```
t
s
let
userAuth
=
new
account_osAccount
.
UserAuth
();
let
userAuth
=
new
account_osAccount
.
UserAuth
();
let
pinAuth
:
account_osAccount
.
PINAuth
=
new
account_osAccount
.
PINAuth
();
let
pinAuth
:
account_osAccount
.
PINAuth
=
new
account_osAccount
.
PINAuth
();
let
challenge
=
new
Uint8Array
([
0
]);
let
challenge
=
new
Uint8Array
([
0
]);
...
@@ -4436,7 +4436,7 @@ constructor()
...
@@ -4436,7 +4436,7 @@ constructor()
**系统能力**
:SystemCapability.Account.OsAccount
**系统能力**
:SystemCapability.Account.OsAccount
**示例:**
**示例:**
```
j
s
```
t
s
let
pinAuth
:
account_osAccount
.
PINAuth
=
new
account_osAccount
.
PINAuth
();
let
pinAuth
:
account_osAccount
.
PINAuth
=
new
account_osAccount
.
PINAuth
();
```
```
...
@@ -4467,7 +4467,7 @@ registerInputer(inputer: IInputer): void;
...
@@ -4467,7 +4467,7 @@ registerInputer(inputer: IInputer): void;
| 12300103 | Inputer already registered. |
| 12300103 | Inputer already registered. |
**示例:**
**示例:**
```
j
s
```
t
s
let
pinAuth
:
account_osAccount
.
PINAuth
=
new
account_osAccount
.
PINAuth
();
let
pinAuth
:
account_osAccount
.
PINAuth
=
new
account_osAccount
.
PINAuth
();
let
password
=
new
Uint8Array
([
0
,
0
,
0
,
0
,
0
]);
let
password
=
new
Uint8Array
([
0
,
0
,
0
,
0
,
0
]);
try
{
try
{
...
@@ -4495,7 +4495,7 @@ unregisterInputer(): void;
...
@@ -4495,7 +4495,7 @@ unregisterInputer(): void;
**需要权限:**
ohos.permission.ACCESS_PIN_AUTH
**需要权限:**
ohos.permission.ACCESS_PIN_AUTH
**示例:**
**示例:**
```
j
s
```
t
s
let
pinAuth
:
account_osAccount
.
PINAuth
=
new
account_osAccount
.
PINAuth
();
let
pinAuth
:
account_osAccount
.
PINAuth
=
new
account_osAccount
.
PINAuth
();
pinAuth
.
unregisterInputer
();
pinAuth
.
unregisterInputer
();
```
```
...
@@ -4533,7 +4533,7 @@ static registerInputer(authType: AuthType, inputer: IInputer): void
...
@@ -4533,7 +4533,7 @@ static registerInputer(authType: AuthType, inputer: IInputer): void
| 12300106 | Unsupported authType. |
| 12300106 | Unsupported authType. |
**示例:**
**示例:**
```
j
s
```
t
s
let
authType
=
account_osAccount
.
AuthType
.
DOMAIN
;
let
authType
=
account_osAccount
.
AuthType
.
DOMAIN
;
let
password
:
Uint8Array
=
new
Uint8Array
([
0
,
0
,
0
,
0
,
0
]);
let
password
:
Uint8Array
=
new
Uint8Array
([
0
,
0
,
0
,
0
,
0
]);
try
{
try
{
...
@@ -4573,7 +4573,7 @@ static unregisterInputer(authType: AuthType): void
...
@@ -4573,7 +4573,7 @@ static unregisterInputer(authType: AuthType): void
| 12300002 | Invalid authType. |
| 12300002 | Invalid authType. |
**示例:**
**示例:**
```
j
s
```
t
s
let
authType
=
account_osAccount
.
AuthType
.
DOMAIN
;
let
authType
=
account_osAccount
.
AuthType
.
DOMAIN
;
try
{
try
{
account_osAccount
.
InputerManager
.
unregisterInputer
(
authType
);
account_osAccount
.
InputerManager
.
unregisterInputer
(
authType
);
...
@@ -4608,7 +4608,7 @@ auth(domainAccountInfo: DomainAccountInfo, credential: Uint8Array, callback: IUs
...
@@ -4608,7 +4608,7 @@ auth(domainAccountInfo: DomainAccountInfo, credential: Uint8Array, callback: IUs
| callback |
[
IUserAuthCallback
](
#iuserauthcallback8
)
| 是 | 指示认证结果回调。|
| callback |
[
IUserAuthCallback
](
#iuserauthcallback8
)
| 是 | 指示认证结果回调。|
**示例:**
**示例:**
```
j
s
```
t
s
import
{
AsyncCallback
}
from
'
./@ohos.base
'
;
import
{
AsyncCallback
}
from
'
./@ohos.base
'
;
let
plugin
:
account_osAccount
.
DomainPlugin
=
{
let
plugin
:
account_osAccount
.
DomainPlugin
=
{
auth
:
(
domainAccountInfo
:
account_osAccount
.
DomainAccountInfo
,
credential
:
Uint8Array
,
auth
:
(
domainAccountInfo
:
account_osAccount
.
DomainAccountInfo
,
credential
:
Uint8Array
,
...
@@ -4672,7 +4672,7 @@ authWithPopup(domainAccountInfo: DomainAccountInfo, callback: IUserAuthCallback)
...
@@ -4672,7 +4672,7 @@ authWithPopup(domainAccountInfo: DomainAccountInfo, callback: IUserAuthCallback)
| callback |
[
IUserAuthCallback
](
#iuserauthcallback8
)
| 是 | 指示认证结果回调。|
| callback |
[
IUserAuthCallback
](
#iuserauthcallback8
)
| 是 | 指示认证结果回调。|
**示例:**
**示例:**
```
j
s
```
t
s
import
{
AsyncCallback
}
from
'
./@ohos.base
'
;
import
{
AsyncCallback
}
from
'
./@ohos.base
'
;
let
plugin
:
account_osAccount
.
DomainPlugin
=
{
let
plugin
:
account_osAccount
.
DomainPlugin
=
{
auth
:
(
domainAccountInfo
:
account_osAccount
.
DomainAccountInfo
,
credential
:
Uint8Array
,
auth
:
(
domainAccountInfo
:
account_osAccount
.
DomainAccountInfo
,
credential
:
Uint8Array
,
...
@@ -4723,7 +4723,7 @@ authWithToken(domainAccountInfo: DomainAccountInfo, token: Uint8Array, callback:
...
@@ -4723,7 +4723,7 @@ authWithToken(domainAccountInfo: DomainAccountInfo, token: Uint8Array, callback:
| callback |
[
IUserAuthCallback
](
#iuserauthcallback8
)
| 是 | 指示认证结果回调。|
| callback |
[
IUserAuthCallback
](
#iuserauthcallback8
)
| 是 | 指示认证结果回调。|
**示例:**
**示例:**
```
j
s
```
t
s
import
{
AsyncCallback
}
from
'
./@ohos.base
'
;
import
{
AsyncCallback
}
from
'
./@ohos.base
'
;
let
plugin
:
account_osAccount
.
DomainPlugin
=
{
let
plugin
:
account_osAccount
.
DomainPlugin
=
{
auth
:
(
domainAccountInfo
:
account_osAccount
.
DomainAccountInfo
,
credential
:
Uint8Array
,
auth
:
(
domainAccountInfo
:
account_osAccount
.
DomainAccountInfo
,
credential
:
Uint8Array
,
...
@@ -4773,7 +4773,7 @@ getAccountInfo(options: GetDomainAccountInfoPluginOptions, callback: AsyncCallba
...
@@ -4773,7 +4773,7 @@ getAccountInfo(options: GetDomainAccountInfoPluginOptions, callback: AsyncCallba
| callback | AsyncCallback
<
[DomainAccountInfo](#domainaccountinfo8)
>
| 是 | 指示查询结果回调。|
| callback | AsyncCallback
<
[DomainAccountInfo](#domainaccountinfo8)
>
| 是 | 指示查询结果回调。|
**示例:**
**示例:**
```
j
s
```
t
s
import
{
AsyncCallback
,
BusinessError
}
from
'
@ohos.base
'
;
import
{
AsyncCallback
,
BusinessError
}
from
'
@ohos.base
'
;
let
plugin
:
account_osAccount
.
DomainPlugin
=
{
let
plugin
:
account_osAccount
.
DomainPlugin
=
{
auth
:
(
domainAccountInfo
:
account_osAccount
.
DomainAccountInfo
,
credential
:
Uint8Array
,
auth
:
(
domainAccountInfo
:
account_osAccount
.
DomainAccountInfo
,
credential
:
Uint8Array
,
...
@@ -4828,7 +4828,7 @@ getAuthStatusInfo(domainAccountInfo: DomainAccountInfo, callback: AsyncCallback&
...
@@ -4828,7 +4828,7 @@ getAuthStatusInfo(domainAccountInfo: DomainAccountInfo, callback: AsyncCallback&
| callback | AsyncCallback
<
[AuthStatusInfo](#authstatusinfo10)
>
| 是 | 指示查询结果回调。|
| callback | AsyncCallback
<
[AuthStatusInfo](#authstatusinfo10)
>
| 是 | 指示查询结果回调。|
**示例:**
**示例:**
```
j
s
```
t
s
import
{
AsyncCallback
,
BusinessError
}
from
'
@ohos.base
'
;
import
{
AsyncCallback
,
BusinessError
}
from
'
@ohos.base
'
;
let
plugin
:
account_osAccount
.
DomainPlugin
=
{
let
plugin
:
account_osAccount
.
DomainPlugin
=
{
auth
:
(
domainAccountInfo
:
account_osAccount
.
DomainAccountInfo
,
credential
:
Uint8Array
,
auth
:
(
domainAccountInfo
:
account_osAccount
.
DomainAccountInfo
,
credential
:
Uint8Array
,
...
@@ -4880,7 +4880,7 @@ bindAccount(domainAccountInfo: DomainAccountInfo, localId: number, callback: Asy
...
@@ -4880,7 +4880,7 @@ bindAccount(domainAccountInfo: DomainAccountInfo, localId: number, callback: Asy
| callback | AsyncCallback
<
void
>
| 是 | 指示绑定结果回调。|
| callback | AsyncCallback
<
void
>
| 是 | 指示绑定结果回调。|
**示例:**
**示例:**
```
j
s
```
t
s
import
{
AsyncCallback
,
BusinessError
}
from
'
./@ohos.base
'
;
import
{
AsyncCallback
,
BusinessError
}
from
'
./@ohos.base
'
;
let
plugin
:
account_osAccount
.
DomainPlugin
=
{
let
plugin
:
account_osAccount
.
DomainPlugin
=
{
auth
:
(
domainAccountInfo
:
account_osAccount
.
DomainAccountInfo
,
credential
:
Uint8Array
,
auth
:
(
domainAccountInfo
:
account_osAccount
.
DomainAccountInfo
,
credential
:
Uint8Array
,
...
@@ -4930,7 +4930,7 @@ unbindAccount(domainAccountInfo: DomainAccountInfo, callback: AsyncCallback<v
...
@@ -4930,7 +4930,7 @@ unbindAccount(domainAccountInfo: DomainAccountInfo, callback: AsyncCallback<v
| callback | AsyncCallback
<
void
>
| 是 | 指示绑定结果回调。|
| callback | AsyncCallback
<
void
>
| 是 | 指示绑定结果回调。|
**示例:**
**示例:**
```
j
s
```
t
s
import
{
AsyncCallback
,
BusinessError
}
from
'
./@ohos.base
'
;
import
{
AsyncCallback
,
BusinessError
}
from
'
./@ohos.base
'
;
let
plugin
:
account_osAccount
.
DomainPlugin
=
{
let
plugin
:
account_osAccount
.
DomainPlugin
=
{
auth
:
(
domainAccountInfo
:
account_osAccount
.
DomainAccountInfo
,
credential
:
Uint8Array
,
auth
:
(
domainAccountInfo
:
account_osAccount
.
DomainAccountInfo
,
credential
:
Uint8Array
,
...
@@ -4981,7 +4981,7 @@ isAccountTokenValid(domainAccountInfo: DomainAccountInfo, token: Uint8Array, cal
...
@@ -4981,7 +4981,7 @@ isAccountTokenValid(domainAccountInfo: DomainAccountInfo, token: Uint8Array, cal
| callback | AsyncCallback
<
boolean
>
| 是 | 指示检查结果回调。|
| callback | AsyncCallback
<
boolean
>
| 是 | 指示检查结果回调。|
**示例:**
**示例:**
```
j
s
```
t
s
import
{
AsyncCallback
,
BusinessError
}
from
'
./@ohos.base
'
;
import
{
AsyncCallback
,
BusinessError
}
from
'
./@ohos.base
'
;
let
plugin
:
account_osAccount
.
DomainPlugin
=
{
let
plugin
:
account_osAccount
.
DomainPlugin
=
{
auth
:
(
domainAccountInfo
:
account_osAccount
.
DomainAccountInfo
,
credential
:
Uint8Array
,
auth
:
(
domainAccountInfo
:
account_osAccount
.
DomainAccountInfo
,
credential
:
Uint8Array
,
...
@@ -5031,7 +5031,7 @@ getAccessToken(options: GetDomainAccessTokenOptions, callback: AsyncCallback<
...
@@ -5031,7 +5031,7 @@ getAccessToken(options: GetDomainAccessTokenOptions, callback: AsyncCallback<
| callback | AsyncCallback
<
Uint8Array
>
| 是 | 指示结果回调。|
| callback | AsyncCallback
<
Uint8Array
>
| 是 | 指示结果回调。|
**示例:**
**示例:**
```
j
s
```
t
s
import
{
AsyncCallback
,
BusinessError
}
from
'
./@ohos.base
'
;
import
{
AsyncCallback
,
BusinessError
}
from
'
./@ohos.base
'
;
let
plugin
:
account_osAccount
.
DomainPlugin
=
{
let
plugin
:
account_osAccount
.
DomainPlugin
=
{
auth
:
(
domainAccountInfo
:
account_osAccount
.
DomainAccountInfo
,
credential
:
Uint8Array
,
auth
:
(
domainAccountInfo
:
account_osAccount
.
DomainAccountInfo
,
credential
:
Uint8Array
,
...
@@ -5092,7 +5092,7 @@ static registerPlugin(plugin: DomainPlugin): void
...
@@ -5092,7 +5092,7 @@ static registerPlugin(plugin: DomainPlugin): void
| 12300201 | The domain plugin has been registered. |
| 12300201 | The domain plugin has been registered. |
**示例:**
**示例:**
```
j
s
```
t
s
import
{
AsyncCallback
}
from
'
./@ohos.base
'
;
import
{
AsyncCallback
}
from
'
./@ohos.base
'
;
let
plugin
:
account_osAccount
.
DomainPlugin
=
{
let
plugin
:
account_osAccount
.
DomainPlugin
=
{
auth
:
(
domainAccountInfo
:
account_osAccount
.
DomainAccountInfo
,
credential
:
Uint8Array
,
auth
:
(
domainAccountInfo
:
account_osAccount
.
DomainAccountInfo
,
credential
:
Uint8Array
,
...
@@ -5133,7 +5133,7 @@ static unregisterPlugin(): void
...
@@ -5133,7 +5133,7 @@ static unregisterPlugin(): void
**需要权限:**
ohos.permission.MANAGE_LOCAL_ACCOUNTS
**需要权限:**
ohos.permission.MANAGE_LOCAL_ACCOUNTS
**示例:**
**示例:**
```
j
s
```
t
s
try
{
try
{
account_osAccount
.
DomainAccountManager
.
unregisterPlugin
();
account_osAccount
.
DomainAccountManager
.
unregisterPlugin
();
console
.
log
(
'
unregisterPlugin success.
'
);
console
.
log
(
'
unregisterPlugin success.
'
);
...
@@ -5179,7 +5179,7 @@ auth(domainAccountInfo: DomainAccountInfo, credential: Uint8Array, callback: IUs
...
@@ -5179,7 +5179,7 @@ auth(domainAccountInfo: DomainAccountInfo, credential: Uint8Array, callback: IUs
| 12300114 | Authentication service exception. |
| 12300114 | Authentication service exception. |
**示例:**
**示例:**
```
j
s
```
t
s
let
domainAccountInfo
:
account_osAccount
.
DomainAccountInfo
=
{
let
domainAccountInfo
:
account_osAccount
.
DomainAccountInfo
=
{
domain
:
'
CHINA
'
,
domain
:
'
CHINA
'
,
accountName
:
'
zhangsan
'
accountName
:
'
zhangsan
'
...
@@ -5231,7 +5231,7 @@ authWithPopup(callback: IUserAuthCallback): void
...
@@ -5231,7 +5231,7 @@ authWithPopup(callback: IUserAuthCallback): void
| 12300114 | Authentication service exception. |
| 12300114 | Authentication service exception. |
**示例:**
**示例:**
```
j
s
```
t
s
try
{
try
{
account_osAccount
.
DomainAccountManager
.
authWithPopup
({
account_osAccount
.
DomainAccountManager
.
authWithPopup
({
onResult
:
(
resultCode
:
number
,
authResult
:
account_osAccount
.
AuthResult
)
=>
{
onResult
:
(
resultCode
:
number
,
authResult
:
account_osAccount
.
AuthResult
)
=>
{
...
@@ -5280,7 +5280,7 @@ authWithPopup(localId: number, callback: IUserAuthCallback): void
...
@@ -5280,7 +5280,7 @@ authWithPopup(localId: number, callback: IUserAuthCallback): void
| 12300114 | Authentication service exception. |
| 12300114 | Authentication service exception. |
**示例:**
**示例:**
```
j
s
```
t
s
try
{
try
{
account_osAccount
.
DomainAccountManager
.
authWithPopup
(
100
,
{
account_osAccount
.
DomainAccountManager
.
authWithPopup
(
100
,
{
onResult
:
(
resultCode
:
number
,
authResult
:
account_osAccount
.
AuthResult
)
=>
{
onResult
:
(
resultCode
:
number
,
authResult
:
account_osAccount
.
AuthResult
)
=>
{
...
@@ -5321,7 +5321,7 @@ hasAccount(domainAccountInfo: DomainAccountInfo, callback: AsyncCallback<bool
...
@@ -5321,7 +5321,7 @@ hasAccount(domainAccountInfo: DomainAccountInfo, callback: AsyncCallback<bool
| 12300013 | Network exception. |
| 12300013 | Network exception. |
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
domainAccountInfo
:
account_osAccount
.
DomainAccountInfo
=
{
let
domainAccountInfo
:
account_osAccount
.
DomainAccountInfo
=
{
domain
:
'
CHINA
'
,
domain
:
'
CHINA
'
,
...
@@ -5373,7 +5373,7 @@ hasAccount(domainAccountInfo: DomainAccountInfo): Promise<boolean>
...
@@ -5373,7 +5373,7 @@ hasAccount(domainAccountInfo: DomainAccountInfo): Promise<boolean>
| 12300013 | Network exception. |
| 12300013 | Network exception. |
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
domainAccountInfo
:
account_osAccount
.
DomainAccountInfo
=
{
let
domainAccountInfo
:
account_osAccount
.
DomainAccountInfo
=
{
domain
:
'
CHINA
'
,
domain
:
'
CHINA
'
,
...
@@ -5419,7 +5419,7 @@ updateAccountToken(domainAccountInfo: DomainAccountInfo, token: Uint8Array, call
...
@@ -5419,7 +5419,7 @@ updateAccountToken(domainAccountInfo: DomainAccountInfo, token: Uint8Array, call
| 12300003 | Account not found. |
| 12300003 | Account not found. |
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
domainAccountInfo
:
account_osAccount
.
DomainAccountInfo
=
{
let
domainAccountInfo
:
account_osAccount
.
DomainAccountInfo
=
{
domain
:
'
CHINA
'
,
domain
:
'
CHINA
'
,
...
@@ -5474,7 +5474,7 @@ updateAccountToken(domainAccountInfo: DomainAccountInfo, token: Uint8Array): Pro
...
@@ -5474,7 +5474,7 @@ updateAccountToken(domainAccountInfo: DomainAccountInfo, token: Uint8Array): Pro
| 12300003 | Account not found. |
| 12300003 | Account not found. |
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
domainAccountInfo
:
account_osAccount
.
DomainAccountInfo
=
{
let
domainAccountInfo
:
account_osAccount
.
DomainAccountInfo
=
{
domain
:
'
CHINA
'
,
domain
:
'
CHINA
'
,
...
@@ -5510,7 +5510,7 @@ constructor()
...
@@ -5510,7 +5510,7 @@ constructor()
**系统能力**
:SystemCapability.Account.OsAccount
**系统能力**
:SystemCapability.Account.OsAccount
**示例:**
**示例:**
```
j
s
```
t
s
let
userIDM
=
new
account_osAccount
.
UserIdentityManager
();
let
userIDM
=
new
account_osAccount
.
UserIdentityManager
();
```
```
...
@@ -5539,7 +5539,7 @@ openSession(callback: AsyncCallback<Uint8Array>): void;
...
@@ -5539,7 +5539,7 @@ openSession(callback: AsyncCallback<Uint8Array>): void;
| 12300001 | System service exception. |
| 12300001 | System service exception. |
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
userIDM
=
new
account_osAccount
.
UserIdentityManager
();
let
userIDM
=
new
account_osAccount
.
UserIdentityManager
();
try
{
try
{
...
@@ -5577,7 +5577,7 @@ openSession(): Promise<Uint8Array>;
...
@@ -5577,7 +5577,7 @@ openSession(): Promise<Uint8Array>;
| 12300001 | System service exception. |
| 12300001 | System service exception. |
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
userIDM
=
new
account_osAccount
.
UserIdentityManager
();
let
userIDM
=
new
account_osAccount
.
UserIdentityManager
();
try
{
try
{
...
@@ -5623,7 +5623,7 @@ addCredential(credentialInfo: CredentialInfo, callback: IIdmCallback): void;
...
@@ -5623,7 +5623,7 @@ addCredential(credentialInfo: CredentialInfo, callback: IIdmCallback): void;
| 12300115 | The number of credentials reaches the upper limit. |
| 12300115 | The number of credentials reaches the upper limit. |
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
password
:
Uint8Array
=
new
Uint8Array
([
0
,
0
,
0
,
0
,
0
,
0
]);
let
password
:
Uint8Array
=
new
Uint8Array
([
0
,
0
,
0
,
0
,
0
,
0
]);
let
pinAuth
:
account_osAccount
.
PINAuth
=
new
account_osAccount
.
PINAuth
();
let
pinAuth
:
account_osAccount
.
PINAuth
=
new
account_osAccount
.
PINAuth
();
...
@@ -5684,7 +5684,7 @@ updateCredential(credentialInfo: CredentialInfo, callback: IIdmCallback): void;
...
@@ -5684,7 +5684,7 @@ updateCredential(credentialInfo: CredentialInfo, callback: IIdmCallback): void;
| 12300111 | Operation timeout. |
| 12300111 | Operation timeout. |
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
userIDM
=
new
account_osAccount
.
UserIdentityManager
();
let
userIDM
=
new
account_osAccount
.
UserIdentityManager
();
let
userAuth
:
account_osAccount
.
UserAuth
=
new
account_osAccount
.
UserAuth
();
let
userAuth
:
account_osAccount
.
UserAuth
=
new
account_osAccount
.
UserAuth
();
...
@@ -5737,7 +5737,7 @@ closeSession(): void;
...
@@ -5737,7 +5737,7 @@ closeSession(): void;
**需要权限:**
ohos.permission.MANAGE_USER_IDM
**需要权限:**
ohos.permission.MANAGE_USER_IDM
**示例:**
**示例:**
```
j
s
```
t
s
let
userIDM
=
new
account_osAccount
.
UserIdentityManager
();
let
userIDM
=
new
account_osAccount
.
UserIdentityManager
();
userIDM
.
closeSession
();
userIDM
.
closeSession
();
```
```
...
@@ -5768,7 +5768,7 @@ cancel(challenge: Uint8Array): void;
...
@@ -5768,7 +5768,7 @@ cancel(challenge: Uint8Array): void;
| 12300002 | Invalid challenge. |
| 12300002 | Invalid challenge. |
**示例:**
**示例:**
```
j
s
```
t
s
let
userIDM
=
new
account_osAccount
.
UserIdentityManager
();
let
userIDM
=
new
account_osAccount
.
UserIdentityManager
();
let
challenge
:
Uint8Array
=
new
Uint8Array
([
0
]);
let
challenge
:
Uint8Array
=
new
Uint8Array
([
0
]);
try
{
try
{
...
@@ -5805,7 +5805,7 @@ delUser(token: Uint8Array, callback: IIdmCallback): void;
...
@@ -5805,7 +5805,7 @@ delUser(token: Uint8Array, callback: IIdmCallback): void;
| 12300101 | Token is invalid. |
| 12300101 | Token is invalid. |
**示例:**
**示例:**
```
j
s
```
t
s
let
userIDM
=
new
account_osAccount
.
UserIdentityManager
();
let
userIDM
=
new
account_osAccount
.
UserIdentityManager
();
let
token
:
Uint8Array
=
new
Uint8Array
([
0
]);
let
token
:
Uint8Array
=
new
Uint8Array
([
0
]);
try
{
try
{
...
@@ -5850,7 +5850,7 @@ delCred(credentialId: Uint8Array, token: Uint8Array, callback: IIdmCallback): vo
...
@@ -5850,7 +5850,7 @@ delCred(credentialId: Uint8Array, token: Uint8Array, callback: IIdmCallback): vo
| 12300102 | Credential not enrolled. |
| 12300102 | Credential not enrolled. |
**示例:**
**示例:**
```
j
s
```
t
s
let
userIDM
=
new
account_osAccount
.
UserIdentityManager
();
let
userIDM
=
new
account_osAccount
.
UserIdentityManager
();
let
credentialId
:
Uint8Array
=
new
Uint8Array
([
0
]);
let
credentialId
:
Uint8Array
=
new
Uint8Array
([
0
]);
let
token
:
Uint8Array
=
new
Uint8Array
([
0
]);
let
token
:
Uint8Array
=
new
Uint8Array
([
0
]);
...
@@ -5892,7 +5892,7 @@ getAuthInfo(callback: AsyncCallback<Array<EnrolledCredInfo>>): void;
...
@@ -5892,7 +5892,7 @@ getAuthInfo(callback: AsyncCallback<Array<EnrolledCredInfo>>): void;
| 12300102 | Credential not enrolled. |
| 12300102 | Credential not enrolled. |
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
userIDM
=
new
account_osAccount
.
UserIdentityManager
();
let
userIDM
=
new
account_osAccount
.
UserIdentityManager
();
try
{
try
{
...
@@ -5933,7 +5933,7 @@ getAuthInfo(authType: AuthType, callback: AsyncCallback<Array<EnrolledCred
...
@@ -5933,7 +5933,7 @@ getAuthInfo(authType: AuthType, callback: AsyncCallback<Array<EnrolledCred
| 12300102 | Credential not enrolled. |
| 12300102 | Credential not enrolled. |
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
userIDM
=
new
account_osAccount
.
UserIdentityManager
();
let
userIDM
=
new
account_osAccount
.
UserIdentityManager
();
try
{
try
{
...
@@ -5980,7 +5980,7 @@ getAuthInfo(authType?: AuthType): Promise<Array<EnrolledCredInfo>>;
...
@@ -5980,7 +5980,7 @@ getAuthInfo(authType?: AuthType): Promise<Array<EnrolledCredInfo>>;
| 12300102 | Credential not enrolled. |
| 12300102 | Credential not enrolled. |
**示例:**
**示例:**
```
j
s
```
t
s
import
{
BusinessError
}
from
'
@ohos.base
'
;
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
userIDM
=
new
account_osAccount
.
UserIdentityManager
();
let
userIDM
=
new
account_osAccount
.
UserIdentityManager
();
try
{
try
{
...
@@ -6024,7 +6024,7 @@ onSetData: (authSubType: AuthSubType, data: Uint8Array) => void;
...
@@ -6024,7 +6024,7 @@ onSetData: (authSubType: AuthSubType, data: Uint8Array) => void;
| 12300002 | Invalid pinSubType. |
| 12300002 | Invalid pinSubType. |
**示例:**
**示例:**
```
j
s
```
t
s
let
password
:
Uint8Array
=
new
Uint8Array
([
0
,
0
,
0
,
0
,
0
,
0
]);
let
password
:
Uint8Array
=
new
Uint8Array
([
0
,
0
,
0
,
0
,
0
,
0
]);
let
passwordNumber
:
Uint8Array
=
new
Uint8Array
([
1
,
2
,
3
,
4
]);
let
passwordNumber
:
Uint8Array
=
new
Uint8Array
([
1
,
2
,
3
,
4
]);
let
inputer
:
account_osAccount
.
IInputer
=
{
let
inputer
:
account_osAccount
.
IInputer
=
{
...
@@ -6061,7 +6061,7 @@ onGetData: (authSubType: AuthSubType, callback: IInputData) => void;
...
@@ -6061,7 +6061,7 @@ onGetData: (authSubType: AuthSubType, callback: IInputData) => void;
| callback |
[
IInputData
](
#iinputdata8
)
| 是 | 指示密码数据回调。|
| callback |
[
IInputData
](
#iinputdata8
)
| 是 | 指示密码数据回调。|
**示例:**
**示例:**
```
j
s
```
t
s
let
password
:
Uint8Array
=
new
Uint8Array
([
0
,
0
,
0
,
0
,
0
,
0
]);
let
password
:
Uint8Array
=
new
Uint8Array
([
0
,
0
,
0
,
0
,
0
,
0
]);
let
passwordNumber
:
Uint8Array
=
new
Uint8Array
([
1
,
2
,
3
,
4
]);
let
passwordNumber
:
Uint8Array
=
new
Uint8Array
([
1
,
2
,
3
,
4
]);
let
inputer
:
account_osAccount
.
IInputer
=
{
let
inputer
:
account_osAccount
.
IInputer
=
{
...
@@ -6102,7 +6102,7 @@ onResult: (result: number, extraInfo: AuthResult) => void;
...
@@ -6102,7 +6102,7 @@ onResult: (result: number, extraInfo: AuthResult) => void;
| extraInfo |
[
AuthResult
](
#authresult8
)
| 是 | 表示不同情况下的具体信息,如果认证通过,则在extrainfo中返回认证令牌,如果身份验证失败,则在extrainfo中返回剩余的身份验证时间,如果身份验证执行器被锁定,冻结时间将在extrainfo中返回。|
| extraInfo |
[
AuthResult
](
#authresult8
)
| 是 | 表示不同情况下的具体信息,如果认证通过,则在extrainfo中返回认证令牌,如果身份验证失败,则在extrainfo中返回剩余的身份验证时间,如果身份验证执行器被锁定,冻结时间将在extrainfo中返回。|
**示例:**
**示例:**
```
j
s
```
t
s
let
authCallback
:
account_osAccount
.
IUserAuthCallback
=
{
let
authCallback
:
account_osAccount
.
IUserAuthCallback
=
{
onResult
:
(
result
:
number
,
extraInfo
:
account_osAccount
.
AuthResult
)
=>
{
onResult
:
(
result
:
number
,
extraInfo
:
account_osAccount
.
AuthResult
)
=>
{
console
.
log
(
'
auth result =
'
+
result
);
console
.
log
(
'
auth result =
'
+
result
);
...
@@ -6130,7 +6130,7 @@ onAcquireInfo?: (module: number, acquire: number, extraInfo: any) => void;
...
@@ -6130,7 +6130,7 @@ onAcquireInfo?: (module: number, acquire: number, extraInfo: any) => void;
| extraInfo | any | 是 | 保留参数。 |
| extraInfo | any | 是 | 保留参数。 |
**示例:**
**示例:**
```
j
s
```
t
s
let
authCallback
:
account_osAccount
.
IUserAuthCallback
=
{
let
authCallback
:
account_osAccount
.
IUserAuthCallback
=
{
onResult
:
(
result
:
number
,
extraInfo
:
account_osAccount
.
AuthResult
)
=>
{
onResult
:
(
result
:
number
,
extraInfo
:
account_osAccount
.
AuthResult
)
=>
{
console
.
log
(
'
auth result =
'
+
result
)
console
.
log
(
'
auth result =
'
+
result
)
...
@@ -6168,7 +6168,7 @@ onResult: (result: number, extraInfo: RequestResult) => void;
...
@@ -6168,7 +6168,7 @@ onResult: (result: number, extraInfo: RequestResult) => void;
| extraInfo |
[
RequestResult
](
#requestresult8
)
| 是 | 针对不同情况传递具体信息。|
| extraInfo |
[
RequestResult
](
#requestresult8
)
| 是 | 针对不同情况传递具体信息。|
**示例:**
**示例:**
```
j
s
```
t
s
let
idmCallback
:
account_osAccount
.
IIdmCallback
=
{
let
idmCallback
:
account_osAccount
.
IIdmCallback
=
{
onResult
:
(
result
:
number
,
extraInfo
:
account_osAccount
.
RequestResult
)
=>
{
onResult
:
(
result
:
number
,
extraInfo
:
account_osAccount
.
RequestResult
)
=>
{
console
.
log
(
'
callback result =
'
+
result
)
console
.
log
(
'
callback result =
'
+
result
)
...
@@ -6196,7 +6196,7 @@ onAcquireInfo?: (module: number, acquire: number, extraInfo: any) => void;
...
@@ -6196,7 +6196,7 @@ onAcquireInfo?: (module: number, acquire: number, extraInfo: any) => void;
| extraInfo | any | 是 | 保留参数。 |
| extraInfo | any | 是 | 保留参数。 |
**示例:**
**示例:**
```
j
s
```
t
s
let
idmCallback
:
account_osAccount
.
IIdmCallback
=
{
let
idmCallback
:
account_osAccount
.
IIdmCallback
=
{
onResult
:
(
result
:
number
,
extraInfo
:
Object
)
=>
{
onResult
:
(
result
:
number
,
extraInfo
:
Object
)
=>
{
console
.
log
(
'
callback result =
'
+
result
)
console
.
log
(
'
callback result =
'
+
result
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录