Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
73ae49f2
D
Docs
项目概览
OpenHarmony
/
Docs
1 年多 前同步成功
通知
159
Star
292
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看板
提交
73ae49f2
编写于
9月 21, 2022
作者:
F
fanchenxuan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
代码规范整改
Signed-off-by:
N
fanchenxuan
<
fanchenxuan@huawei.com
>
上级
a6c38fa1
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
259 addition
and
259 deletion
+259
-259
zh-cn/application-dev/reference/apis/js-apis-osAccount.md
zh-cn/application-dev/reference/apis/js-apis-osAccount.md
+259
-259
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-osAccount.md
浏览文件 @
73ae49f2
...
...
@@ -28,7 +28,7 @@ getAccountManager(): AccountManager
**示例:**
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
```
## OsAccountType
...
...
@@ -68,10 +68,10 @@ activateOsAccount(localId: number, callback: AsyncCallback<void>): void
**示例:**
激活ID为100的系统帐号
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
var
localId
=
100
;
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
let
localId
=
100
;
accountManager
.
activateOsAccount
(
localId
,
(
err
)
=>
{
console
.
log
(
"
activateOsAccount err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
'
activateOsAccount err:
'
+
JSON
.
stringify
(
err
));
});
```
...
...
@@ -101,12 +101,12 @@ activateOsAccount(localId: number): Promise<void>
**示例:**
激活ID为100的系统帐号
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
var
localId
=
100
;
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
let
localId
=
100
;
accountManager
.
activateOsAccount
(
localId
).
then
(()
=>
{
console
.
log
(
"
activateOsAccount success
"
);
console
.
log
(
'
activateOsAccount success
'
);
}).
catch
((
err
)
=>
{
console
.
log
(
"
activateOsAccount err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
'
activateOsAccount err:
'
+
JSON
.
stringify
(
err
));
});
```
...
...
@@ -127,9 +127,9 @@ isMultiOsAccountEnable(callback: AsyncCallback<boolean>): void
**示例:**
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
accountManager
.
isMultiOsAccountEnable
((
err
,
isEnabled
)
=>
{
console
.
log
(
"
isMultiOsAccountEnable err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
'
isMultiOsAccountEnable err:
'
+
JSON
.
stringify
(
err
));
console
.
log
(
'
isMultiOsAccountEnable isEnabled:
'
+
isEnabled
);
});
```
...
...
@@ -151,11 +151,11 @@ isMultiOsAccountEnable(): Promise<boolean>
**示例:**
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
accountManager
.
isMultiOsAccountEnable
().
then
((
isEnabled
)
=>
{
console
.
log
(
'
isMultiOsAccountEnable, isEnabled:
'
+
isEnabled
);
}).
catch
((
err
)
=>
{
console
.
log
(
"
isMultiOsAccountEnable err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
'
isMultiOsAccountEnable err:
'
+
JSON
.
stringify
(
err
));
});
```
...
...
@@ -179,11 +179,11 @@ isOsAccountActived(localId: number, callback: AsyncCallback<boolean>): voi
**示例:**
判断ID为100的系统帐号是否处于激活状态
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
var
osLocalId
=
100
;
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
let
osLocalId
=
100
;
accountManager
.
isOsAccountActived
(
osLocalId
,
(
err
,
isActive
)
=>
{
console
.
log
(
"
isOsAccountActived err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
"
isOsAccountActived isActive:
"
+
isActive
);
console
.
log
(
'
isOsAccountActived err:
'
+
JSON
.
stringify
(
err
));
console
.
log
(
'
isOsAccountActived isActive:
'
+
isActive
);
});
```
...
...
@@ -212,12 +212,12 @@ isOsAccountActived(localId: number): Promise<boolean>
**示例:**
判断ID为100的系统帐号是否处于激活状态
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
var
osLocalId
=
100
;
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
let
osLocalId
=
100
;
accountManager
.
isOsAccountActived
(
osLocalId
).
then
((
isActive
)
=>
{
console
.
log
(
'
isOsAccountActived, isActive:
'
+
isActive
);
}).
catch
((
err
)
=>
{
console
.
log
(
"
isOsAccountActived err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
'
isOsAccountActived err:
'
+
JSON
.
stringify
(
err
));
});
```
...
...
@@ -242,11 +242,11 @@ isOsAccountConstraintEnable(localId: number, constraint: string, callback: Async
**示例:**
判断ID为100的系统帐号是否有禁止使用wifi的约束
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
var
localId
=
100
;
accountManager
.
isOsAccountConstraintEnable
(
localId
,
"
constraint.wifi
"
,
(
err
,
isConstraintEnabled
)
=>
{
console
.
log
(
"
isOsAccountConstraintEnable err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
"
isOsAccountConstraintEnable isConstraintEnabled:
"
+
isConstraintEnabled
);
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
let
localId
=
100
;
accountManager
.
isOsAccountConstraintEnable
(
localId
,
'
constraint.wifi
'
,
(
err
,
isConstraintEnabled
)
=>
{
console
.
log
(
'
isOsAccountConstraintEnable err:
'
+
JSON
.
stringify
(
err
));
console
.
log
(
'
isOsAccountConstraintEnable isConstraintEnabled:
'
+
isConstraintEnabled
);
});
```
...
...
@@ -276,12 +276,12 @@ isOsAccountConstraintEnable(localId: number, constraint: string): Promise<boo
**示例:**
判断ID为100的系统帐号是否有禁止使用wifi的约束
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
var
localId
=
100
;
accountManager
.
isOsAccountConstraintEnable
(
localId
,
"
constraint.wifi
"
).
then
((
isConstraintEnabled
)
=>
{
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
let
localId
=
100
;
accountManager
.
isOsAccountConstraintEnable
(
localId
,
'
constraint.wifi
'
).
then
((
isConstraintEnabled
)
=>
{
console
.
log
(
'
isOsAccountConstraintEnable, isConstraintEnabled:
'
+
isConstraintEnabled
);
}).
catch
((
err
)
=>
{
console
.
log
(
"
isOsAccountConstraintEnable err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
'
isOsAccountConstraintEnable err:
'
+
JSON
.
stringify
(
err
));
});
```
...
...
@@ -302,9 +302,9 @@ isTestOsAccount(callback: AsyncCallback<boolean>): void
**示例:**
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
accountManager
.
isTestOsAccount
((
err
,
isTest
)
=>
{
console
.
log
(
"
isTestOsAccount err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
'
isTestOsAccount err:
'
+
JSON
.
stringify
(
err
));
console
.
log
(
'
isTestOsAccount isTest:
'
+
isTest
);
});
```
...
...
@@ -326,11 +326,11 @@ isTestOsAccount(): Promise<boolean>
**示例:**
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
accountManager
.
isTestOsAccount
().
then
((
isTest
)
=>
{
console
.
log
(
'
isTestOsAccount, isTest:
'
+
isTest
);
}).
catch
((
err
)
=>
{
console
.
log
(
"
isTestOsAccount err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
'
isTestOsAccount err:
'
+
JSON
.
stringify
(
err
));
});
```
...
...
@@ -351,9 +351,9 @@ isOsAccountVerified(callback: AsyncCallback<boolean>): void
**示例:**
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
accountManager
.
isOsAccountVerified
((
err
,
isVerified
)
=>
{
console
.
log
(
"
isOsAccountVerified err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
'
isOsAccountVerified err:
'
+
JSON
.
stringify
(
err
));
console
.
log
(
'
isOsAccountVerified isVerified:
'
+
isVerified
);
});
```
...
...
@@ -378,9 +378,9 @@ isOsAccountVerified(localId: number, callback: AsyncCallback<boolean>): vo
**示例:**
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
accountManager
.
isOsAccountVerified
((
err
,
isVerified
)
=>
{
console
.
log
(
"
isOsAccountVerified err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
'
isOsAccountVerified err:
'
+
JSON
.
stringify
(
err
));
console
.
log
(
'
isOsAccountVerified isVerified:
'
+
isVerified
);
});
```
...
...
@@ -410,11 +410,11 @@ isOsAccountVerified(localId?: number): Promise<boolean>
**示例:**
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
accountManager
.
isOsAccountVerified
().
then
((
isVerified
)
=>
{
console
.
log
(
'
isOsAccountVerified, isVerified:
'
+
isVerified
);
}).
catch
((
err
)
=>
{
console
.
log
(
"
isOsAccountVerified err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
'
isOsAccountVerified err:
'
+
JSON
.
stringify
(
err
));
});
```
...
...
@@ -440,10 +440,10 @@ removeOsAccount(localId: number, callback: AsyncCallback<void>): void
**示例:**
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
accountManager
.
createOsAccount
(
"
testAccountName
"
,
account_osAccount
.
OsAccountType
.
NORMAL
,
(
err
,
osAccountInfo
)
=>
{
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
accountManager
.
createOsAccount
(
'
testAccountName
'
,
account_osAccount
.
OsAccountType
.
NORMAL
,
(
err
,
osAccountInfo
)
=>
{
accountManager
.
removeOsAccount
(
osAccountInfo
.
localId
,
(
err
)
=>
{
console
.
log
(
"
removeOsAccount err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
'
removeOsAccount err:
'
+
JSON
.
stringify
(
err
));
});
});
```
...
...
@@ -475,12 +475,12 @@ removeOsAccount(localId: number): Promise<void>
**示例:**
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
accountManager
.
createOsAccount
(
"
testAccountName
"
,
account_osAccount
.
OsAccountType
.
NORMAL
,
(
err
,
osAccountInfo
)
=>
{
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
accountManager
.
createOsAccount
(
'
testAccountName
'
,
account_osAccount
.
OsAccountType
.
NORMAL
,
(
err
,
osAccountInfo
)
=>
{
accountManager
.
removeOsAccount
(
osAccountInfo
.
localId
).
then
(()
=>
{
console
.
log
(
'
removeOsAccount Success
'
);
}).
catch
(()
=>
{
console
.
log
(
"
removeOsAccount err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
'
removeOsAccount err:
'
+
JSON
.
stringify
(
err
));
});
});
```
...
...
@@ -509,10 +509,10 @@ setOsAccountConstraints(localId: number, constraints: Array<string>, enabl
**示例:**
给ID为100的系统帐号设置禁止使用wifi的约束
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
var
localId
=
100
;
accountManager
.
setOsAccountConstraints
(
localId
,
[
"
constraint.wifi
"
],
true
,
(
err
)
=>
{
console
.
log
(
"
setOsAccountConstraints err:
"
+
JSON
.
stringify
(
err
));
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
let
localId
=
100
;
accountManager
.
setOsAccountConstraints
(
localId
,
[
'
constraint.wifi
'
],
true
,
(
err
)
=>
{
console
.
log
(
'
setOsAccountConstraints err:
'
+
JSON
.
stringify
(
err
));
});
```
...
...
@@ -545,12 +545,12 @@ setOsAccountConstraints(localId: number, constraints: Array<string>, enabl
**示例:**
删除ID为100的系统帐号的禁止使用wifi的约束
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
var
localId
=
100
;
accountManager
.
setOsAccountConstraints
(
localId
,
[
"
constraint.location.set
"
],
false
).
then
(()
=>
{
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
let
localId
=
100
;
accountManager
.
setOsAccountConstraints
(
localId
,
[
'
constraint.location.set
'
],
false
).
then
(()
=>
{
console
.
log
(
'
setOsAccountConstraints Success
'
);
}).
catch
((
err
)
=>
{
console
.
log
(
"
setOsAccountConstraints err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
'
setOsAccountConstraints err:
'
+
JSON
.
stringify
(
err
));
});
```
...
...
@@ -577,11 +577,11 @@ setOsAccountName(localId: number, localName: string, callback: AsyncCallback<
**示例:**
将ID为100的系统帐号的帐号名设置成demoName
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
var
localId
=
100
;
var
newName
=
"
demoName
"
;
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
let
localId
=
100
;
let
newName
=
'
demoName
'
;
accountManager
.
setOsAccountName
(
localId
,
newName
,
(
err
)
=>
{
console
.
debug
(
"
setOsAccountName err:
"
+
JSON
.
stringify
(
err
));
console
.
debug
(
'
setOsAccountName err:
'
+
JSON
.
stringify
(
err
));
});
```
...
...
@@ -613,13 +613,13 @@ setOsAccountName(localId: number, localName: string): Promise<void>
**示例:**
将ID为100的系统帐号的帐号名设置成demoName
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
var
localId
=
100
;
var
nameLimit
=
"
demoName
"
;
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
let
localId
=
100
;
let
nameLimit
=
'
demoName
'
;
accountManager
.
setOsAccountName
(
localId
,
nameLimit
).
then
(()
=>
{
console
.
log
(
'
setOsAccountName Success
'
);
}).
catch
((
err
)
=>
{
console
.
log
(
"
setOsAccountName err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
'
setOsAccountName err:
'
+
JSON
.
stringify
(
err
));
});
```
...
...
@@ -642,10 +642,10 @@ getCreatedOsAccountsCount(callback: AsyncCallback<number>): void
**示例:**
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
accountManager
.
getCreatedOsAccountsCount
((
err
,
accountCnt
)
=>
{
console
.
log
(
"
obtains the number of all os accounts created err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
"
obtains the number of all os accounts created accountCnt:
"
+
accountCnt
);
console
.
log
(
'
obtains the number of all os accounts created err:
'
+
JSON
.
stringify
(
err
));
console
.
log
(
'
obtains the number of all os accounts created accountCnt:
'
+
accountCnt
);
});
```
...
...
@@ -668,11 +668,11 @@ getCreatedOsAccountsCount(): Promise<number>
**示例:**
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
accountManager
.
getCreatedOsAccountsCount
().
then
((
accountCnt
)
=>
{
console
.
log
(
'
getCreatedOsAccountsCount, accountCnt:
'
+
accountCnt
);
}).
catch
((
err
)
=>
{
console
.
log
(
"
getCreatedOsAccountsCount err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
'
getCreatedOsAccountsCount err:
'
+
JSON
.
stringify
(
err
));
});
```
...
...
@@ -693,9 +693,9 @@ getOsAccountLocalIdFromProcess(callback: AsyncCallback<number>): void
**示例:**
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
accountManager
.
getOsAccountLocalIdFromProcess
((
err
,
accountID
)
=>
{
console
.
log
(
"
getOsAccountLocalIdFromProcess err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
'
getOsAccountLocalIdFromProcess err:
'
+
JSON
.
stringify
(
err
));
console
.
log
(
'
getOsAccountLocalIdFromProcess accountID:
'
+
accountID
);
});
```
...
...
@@ -717,11 +717,11 @@ getOsAccountLocalIdFromProcess(): Promise<number>
**示例:**
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
accountManager
.
getOsAccountLocalIdFromProcess
().
then
((
accountID
)
=>
{
console
.
log
(
'
getOsAccountLocalIdFromProcess, accountID:
'
+
accountID
);
}).
catch
((
err
)
=>
{
console
.
log
(
"
getOsAccountLocalIdFromProcess err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
'
getOsAccountLocalIdFromProcess err:
'
+
JSON
.
stringify
(
err
));
});
```
...
...
@@ -743,10 +743,10 @@ getOsAccountLocalIdFromUid(uid: number, callback: AsyncCallback<number>):
**示例:**
查询值为12345678的uid所属的系统帐号的帐号ID
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
let
uid
=
12345678
;
accountManager
.
getOsAccountLocalIdFromUid
(
uid
,
(
err
,
accountID
)
=>
{
console
.
log
(
"
getOsAccountLocalIdFromUid err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
'
getOsAccountLocalIdFromUid err:
'
+
JSON
.
stringify
(
err
));
console
.
log
(
'
getOsAccountLocalIdFromUid:
'
+
accountID
);
});
```
...
...
@@ -774,12 +774,12 @@ getOsAccountLocalIdFromUid(uid: number): Promise<number>
**示例:**
查询值为12345678的uid所属的系统帐号的帐号ID
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
let
uid
=
12345678
;
accountManager
.
getOsAccountLocalIdFromUid
(
uid
).
then
((
accountID
)
=>
{
console
.
log
(
'
getOsAccountLocalIdFromUid:
'
+
accountID
);
}).
catch
((
err
)
=>
{
console
.
log
(
"
getOsAccountLocalIdFromUid err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
'
getOsAccountLocalIdFromUid err:
'
+
JSON
.
stringify
(
err
));
});
```
...
...
@@ -803,10 +803,10 @@ getOsAccountLocalIdFromDomain(domainInfo: DomainAccountInfo, callback: AsyncCall
**示例:**
```
js
var
domainInfo
=
{
domain
:
"
testDomain
"
,
accountName
:
"
testAccountName
"
};
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
let
domainInfo
=
{
domain
:
'
testDomain
'
,
accountName
:
'
testAccountName
'
};
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
accountManager
.
getOsAccountLocalIdFromDomain
(
domainInfo
,
(
err
,
accountID
)
=>
{
console
.
log
(
"
getOsAccountLocalIdFromDomain:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
'
getOsAccountLocalIdFromDomain:
'
+
JSON
.
stringify
(
err
));
console
.
log
(
'
getOsAccountLocalIdFromDomain:
'
+
accountID
);
});
```
...
...
@@ -836,12 +836,12 @@ getOsAccountLocalIdFromDomain(domainInfo: DomainAccountInfo): Promise<number&
**示例:**
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
var
domainInfo
=
{
domain
:
"
testDomain
"
,
accountName
:
"
testAccountName
"
};
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
let
domainInfo
=
{
domain
:
'
testDomain
'
,
accountName
:
'
testAccountName
'
};
accountManager
.
getOsAccountLocalIdFromDomain
(
domainInfo
).
then
((
accountID
)
=>
{
console
.
log
(
'
getOsAccountLocalIdFromDomain:
'
+
accountID
);
}).
catch
((
err
)
=>
{
console
.
log
(
"
getOsAccountLocalIdFromDomain err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
'
getOsAccountLocalIdFromDomain err:
'
+
JSON
.
stringify
(
err
));
});
```
...
...
@@ -864,10 +864,10 @@ queryMaxOsAccountNumber(callback: AsyncCallback<number>): void
**示例:**
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
accountManager
.
queryMaxOsAccountNumber
((
err
,
maxCnt
)
=>
{
console
.
log
(
"
queryMaxOsAccountNumber err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
"
queryMaxOsAccountNumber maxCnt:
"
+
maxCnt
);
console
.
log
(
'
queryMaxOsAccountNumber err:
'
+
JSON
.
stringify
(
err
));
console
.
log
(
'
queryMaxOsAccountNumber maxCnt:
'
+
maxCnt
);
});
```
...
...
@@ -890,11 +890,11 @@ queryMaxOsAccountNumber(): Promise<number>
**示例:**
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
accountManager
.
queryMaxOsAccountNumber
().
then
((
maxCnt
)
=>
{
console
.
log
(
'
queryMaxOsAccountNumber, maxCnt:
'
+
maxCnt
);
}).
catch
((
err
)
=>
{
console
.
log
(
"
queryMaxOsAccountNumber err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
'
queryMaxOsAccountNumber err:
'
+
JSON
.
stringify
(
err
));
});
```
...
...
@@ -918,11 +918,11 @@ getOsAccountAllConstraints(localId: number, callback: AsyncCallback<Array<
**示例:**
获取ID为100的系统帐号的全部约束
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
var
localId
=
100
;
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
let
localId
=
100
;
accountManager
.
getOsAccountAllConstraints
(
localId
,
(
err
,
constraints
)
=>
{
console
.
log
(
"
getOsAccountAllConstraints err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
"
getOsAccountAllConstraints:
"
+
JSON
.
stringify
(
constraints
));
console
.
log
(
'
getOsAccountAllConstraints err:
'
+
JSON
.
stringify
(
err
));
console
.
log
(
'
getOsAccountAllConstraints:
'
+
JSON
.
stringify
(
constraints
));
});
```
...
...
@@ -951,12 +951,12 @@ getOsAccountAllConstraints(localId: number): Promise<Array<string>>
**示例:**
获取ID为100的系统帐号的全部约束
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
var
localId
=
100
;
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
let
localId
=
100
;
accountManager
.
getOsAccountAllConstraints
(
localId
).
then
((
constraints
)
=>
{
console
.
log
(
"
getOsAccountAllConstraints, constraints:
"
+
constraints
);
console
.
log
(
'
getOsAccountAllConstraints, constraints:
'
+
constraints
);
}).
catch
((
err
)
=>
{
console
.
log
(
"
getOsAccountAllConstraints err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
'
getOsAccountAllConstraints err:
'
+
JSON
.
stringify
(
err
));
});
```
...
...
@@ -981,10 +981,10 @@ queryAllCreatedOsAccounts(callback: AsyncCallback<Array<OsAccountInfo>&
**示例:**
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
accountManager
.
queryAllCreatedOsAccounts
((
err
,
accountArr
)
=>
{
console
.
log
(
"
queryAllCreatedOsAccounts err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
"
queryAllCreatedOsAccounts accountArr:
"
+
JSON
.
stringify
(
accountArr
));
console
.
log
(
'
queryAllCreatedOsAccounts err:
'
+
JSON
.
stringify
(
err
));
console
.
log
(
'
queryAllCreatedOsAccounts accountArr:
'
+
JSON
.
stringify
(
accountArr
));
});
```
...
...
@@ -1009,11 +1009,11 @@ queryAllCreatedOsAccounts(): Promise<Array<OsAccountInfo>>
**示例:**
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
accountManager
.
queryAllCreatedOsAccounts
().
then
((
accountArr
)
=>
{
console
.
log
(
'
queryAllCreatedOsAccounts, accountArr:
'
+
JSON
.
stringify
(
accountArr
));
}).
catch
((
err
)
=>
{
console
.
log
(
"
queryAllCreatedOsAccounts err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
'
queryAllCreatedOsAccounts err:
'
+
JSON
.
stringify
(
err
));
});
```
...
...
@@ -1034,12 +1034,12 @@ queryActivatedOsAccountIds(callback: AsyncCallback<Array<number>>):
**示例:**
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
accountManager
.
queryActivatedOsAccountIds
((
err
,
idArray
)
=>
{
console
.
log
(
"
queryActivatedOsAccountIds err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
"
queryActivatedOsAccountIds idArray length:
"
+
idArray
.
length
);
for
(
var
i
=
0
;
i
<
idArray
.
length
;
i
++
)
{
console
.
info
(
"
activated os account id:
"
+
idArray
[
i
]);
console
.
log
(
'
queryActivatedOsAccountIds err:
'
+
JSON
.
stringify
(
err
));
console
.
log
(
'
queryActivatedOsAccountIds idArray length:
'
+
idArray
.
length
);
for
(
let
i
=
0
;
i
<
idArray
.
length
;
i
++
)
{
console
.
info
(
'
activated os account id:
'
+
idArray
[
i
]);
}
});
```
...
...
@@ -1061,11 +1061,11 @@ queryActivatedOsAccountIds(): Promise<Array<number>>
**示例:**
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
accountManager
.
queryActivatedOsAccountIds
().
then
((
idArray
)
=>
{
console
.
log
(
'
queryActivatedOsAccountIds, idArray:
'
+
idArray
);
}).
catch
((
err
)
=>
{
console
.
log
(
"
queryActivatedOsAccountIds err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
'
queryActivatedOsAccountIds err:
'
+
JSON
.
stringify
(
err
));
});
```
...
...
@@ -1092,10 +1092,10 @@ createOsAccount(localName: string, type: OsAccountType, callback: AsyncCallback&
**示例:**
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
accountManager
.
createOsAccount
(
"
testName
"
,
account_osAccount
.
OsAccountType
.
NORMAL
,
(
err
,
osAccountInfo
)
=>
{
console
.
log
(
"
createOsAccount err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
"
createOsAccount osAccountInfo:
"
+
JSON
.
stringify
(
osAccountInfo
));
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
accountManager
.
createOsAccount
(
'
testName
'
,
account_osAccount
.
OsAccountType
.
NORMAL
,
(
err
,
osAccountInfo
)
=>
{
console
.
log
(
'
createOsAccount err:
'
+
JSON
.
stringify
(
err
));
console
.
log
(
'
createOsAccount osAccountInfo:
'
+
JSON
.
stringify
(
osAccountInfo
));
});
```
...
...
@@ -1127,11 +1127,11 @@ createOsAccount(localName: string, type: OsAccountType): Promise<OsAccountInf
**示例:**
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
accountManager
.
createOsAccount
(
"
testAccountName
"
,
account_osAccount
.
OsAccountType
.
NORMAL
).
then
((
accountInfo
)
=>
{
console
.
log
(
"
createOsAccount, accountInfo:
"
+
JSON
.
stringify
(
accountInfo
));
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
accountManager
.
createOsAccount
(
'
testAccountName
'
,
account_osAccount
.
OsAccountType
.
NORMAL
).
then
((
accountInfo
)
=>
{
console
.
log
(
'
createOsAccount, accountInfo:
'
+
JSON
.
stringify
(
accountInfo
));
}).
catch
((
err
)
=>
{
console
.
log
(
"
createOsAccount err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
'
createOsAccount err:
'
+
JSON
.
stringify
(
err
));
});
```
...
...
@@ -1158,11 +1158,11 @@ createOsAccountForDomain(type: OsAccountType, domainInfo: DomainAccountInfo, cal
**示例:**
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
var
domainInfo
=
{
domain
:
"
testDomain
"
,
accountName
:
"
testAccountName
"
};
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
let
domainInfo
=
{
domain
:
'
testDomain
'
,
accountName
:
'
testAccountName
'
};
accountManager
.
createOsAccountForDomain
(
account_osAccount
.
OsAccountType
.
NORMAL
,
domainInfo
,
(
err
,
osAccountInfo
)
=>
{
console
.
log
(
"
createOsAccountForDomain err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
"
createOsAccountForDomain osAccountInfo:
"
+
JSON
.
stringify
(
osAccountInfo
));
console
.
log
(
'
createOsAccountForDomain err:
'
+
JSON
.
stringify
(
err
));
console
.
log
(
'
createOsAccountForDomain osAccountInfo:
'
+
JSON
.
stringify
(
osAccountInfo
));
});
```
...
...
@@ -1194,12 +1194,12 @@ createOsAccountForDomain(type: OsAccountType, domainInfo: DomainAccountInfo): Pr
**示例:**
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
var
domainInfo
=
{
domain
:
"
testDomain
"
,
accountName
:
"
testAccountName
"
};
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
let
domainInfo
=
{
domain
:
'
testDomain
'
,
accountName
:
'
testAccountName
'
};
accountManager
.
createOsAccountForDomain
(
account_osAccount
.
OsAccountType
.
NORMAL
,
domainInfo
).
then
((
accountInfo
)
=>
{
console
.
log
(
"
createOsAccountForDomain, account info:
"
+
JSON
.
stringify
(
accountInfo
));
console
.
log
(
'
createOsAccountForDomain, account info:
'
+
JSON
.
stringify
(
accountInfo
));
}).
catch
((
err
)
=>
{
console
.
log
(
"
createOsAccountForDomain err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
'
createOsAccountForDomain err:
'
+
JSON
.
stringify
(
err
));
});
```
...
...
@@ -1222,10 +1222,10 @@ queryCurrentOsAccount(callback: AsyncCallback<OsAccountInfo>): void
**示例:**
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
accountManager
.
queryCurrentOsAccount
((
err
,
curAccountInfo
)
=>
{
console
.
log
(
"
queryCurrentOsAccount err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
"
queryCurrentOsAccount curAccountInfo:
"
+
JSON
.
stringify
(
curAccountInfo
));
console
.
log
(
'
queryCurrentOsAccount err:
'
+
JSON
.
stringify
(
err
));
console
.
log
(
'
queryCurrentOsAccount curAccountInfo:
'
+
JSON
.
stringify
(
curAccountInfo
));
});
```
...
...
@@ -1248,11 +1248,11 @@ queryCurrentOsAccount(): Promise<OsAccountInfo>
**示例:**
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
accountManager
.
queryCurrentOsAccount
().
then
((
accountInfo
)
=>
{
console
.
log
(
"
queryCurrentOsAccount, accountInfo:
"
+
JSON
.
stringify
(
accountInfo
));
console
.
log
(
'
queryCurrentOsAccount, accountInfo:
'
+
JSON
.
stringify
(
accountInfo
));
}).
catch
((
err
)
=>
{
console
.
log
(
"
queryCurrentOsAccount err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
'
queryCurrentOsAccount err:
'
+
JSON
.
stringify
(
err
));
});
```
...
...
@@ -1278,11 +1278,11 @@ queryOsAccountById(localId: number, callback: AsyncCallback<OsAccountInfo>
**示例:**
查询ID为100的系统帐号信息
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
var
localId
=
100
;
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
let
localId
=
100
;
accountManager
.
queryOsAccountById
(
localId
,
(
err
,
accountInfo
)
=>
{
console
.
log
(
"
queryOsAccountById err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
"
queryOsAccountById accountInfo:
"
+
JSON
.
stringify
(
accountInfo
));
console
.
log
(
'
queryOsAccountById err:
'
+
JSON
.
stringify
(
err
));
console
.
log
(
'
queryOsAccountById accountInfo:
'
+
JSON
.
stringify
(
accountInfo
));
});
```
...
...
@@ -1313,12 +1313,12 @@ queryOsAccountById(localId: number): Promise<OsAccountInfo>
**示例:**
查询ID为100的系统帐号信息
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
var
localId
=
100
;
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
let
localId
=
100
;
accountManager
.
queryOsAccountById
(
localId
).
then
((
accountInfo
)
=>
{
console
.
log
(
"
queryOsAccountById, accountInfo:
"
+
JSON
.
stringify
(
accountInfo
));
console
.
log
(
'
queryOsAccountById, accountInfo:
'
+
JSON
.
stringify
(
accountInfo
));
}).
catch
((
err
)
=>
{
console
.
log
(
"
queryOsAccountById err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
'
queryOsAccountById err:
'
+
JSON
.
stringify
(
err
));
});
```
...
...
@@ -1339,9 +1339,9 @@ getOsAccountTypeFromProcess(callback: AsyncCallback<OsAccountType>): void
**示例:**
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
accountManager
.
getOsAccountTypeFromProcess
((
err
,
accountType
)
=>
{
console
.
log
(
"
getOsAccountTypeFromProcess err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
'
getOsAccountTypeFromProcess err:
'
+
JSON
.
stringify
(
err
));
console
.
log
(
'
getOsAccountTypeFromProcess accountType:
'
+
accountType
);
});
```
...
...
@@ -1363,11 +1363,11 @@ getOsAccountTypeFromProcess(): Promise<OsAccountType>
**示例:**
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
accountManager
.
getOsAccountTypeFromProcess
().
then
((
accountType
)
=>
{
console
.
log
(
'
getOsAccountTypeFromProcess, accountType:
'
+
accountType
);
}).
catch
((
err
)
=>
{
console
.
log
(
"
getOsAccountTypeFromProcess err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
'
getOsAccountTypeFromProcess err:
'
+
JSON
.
stringify
(
err
));
});
```
...
...
@@ -1390,9 +1390,9 @@ getDistributedVirtualDeviceId(callback: AsyncCallback<string>): void
**示例:**
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
accountManager
.
getDistributedVirtualDeviceId
((
err
,
virtualID
)
=>
{
console
.
log
(
"
getDistributedVirtualDeviceId err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
'
getDistributedVirtualDeviceId err:
'
+
JSON
.
stringify
(
err
));
console
.
log
(
'
getDistributedVirtualDeviceId virtualID:
'
+
virtualID
);
});
```
...
...
@@ -1416,11 +1416,11 @@ getDistributedVirtualDeviceId(): Promise<string>
**示例:**
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
accountManager
.
getDistributedVirtualDeviceId
().
then
((
virtualID
)
=>
{
console
.
log
(
'
getDistributedVirtualDeviceId, virtualID:
'
+
virtualID
);
}).
catch
((
err
)
=>
{
console
.
log
(
"
getDistributedVirtualDeviceId err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
'
getDistributedVirtualDeviceId err:
'
+
JSON
.
stringify
(
err
));
});
```
...
...
@@ -1446,11 +1446,11 @@ getOsAccountProfilePhoto(localId: number, callback: AsyncCallback<string>)
**示例:**
获取ID为100的系统帐号的头像
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
var
localId
=
100
;
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
let
localId
=
100
;
accountManager
.
getOsAccountProfilePhoto
(
localId
,
(
err
,
photo
)
=>
{
console
.
log
(
"
getOsAccountProfilePhoto err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
"
get photo:
"
+
photo
+
"
by localId:
"
+
localId
);
console
.
log
(
'
getOsAccountProfilePhoto err:
'
+
JSON
.
stringify
(
err
));
console
.
log
(
'
get photo:
'
+
photo
+
'
by localId:
'
+
localId
);
});
```
...
...
@@ -1481,12 +1481,12 @@ getOsAccountProfilePhoto(localId: number): Promise<string>
**示例:**
获取ID为100的系统帐号的头像
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
var
localId
=
100
;
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
let
localId
=
100
;
accountManager
.
getOsAccountProfilePhoto
(
localId
).
then
((
photo
)
=>
{
console
.
log
(
"
getOsAccountProfilePhoto:
"
+
photo
);
console
.
log
(
'
getOsAccountProfilePhoto:
'
+
photo
);
}).
catch
((
err
)
=>
{
console
.
log
(
"
getOsAccountProfilePhoto err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
'
getOsAccountProfilePhoto err:
'
+
JSON
.
stringify
(
err
));
});
```
...
...
@@ -1513,14 +1513,14 @@ setOsAccountProfilePhoto(localId: number, photo: string, callback: AsyncCallback
**示例:**
给ID为100的系统帐号设置头像
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
var
localId
=
100
;
var
photo
=
"
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAAPCAYAAAA/I0V3AAAAAXNSR0IArs4c6QAAAARnQU1BAA
"
+
"
Cxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAACwSURBVDhPvZLBDYMwDEV/ugsXRjAT0EHCOuFIBwkbdIRewi6unbiAyoGgSn1SFH85+Y
"
+
"
q/4ljARW62X+LHS8uIzjm4dXUYF+utzBikB52Jo5e5iEPKqpACk7R9NM2RvWm5tIkD2czLCUFNKLD6IjdMHFHDzws285MgGrT0xCtp3WOKHo
"
+
"
+7q0mP0DZW9pNmoEFUzrQjp5cCnaen2kSJXLFD8ghbXyZCMQf/8e8Ns1XVAG/XAgqKzVnJFAAAAABJRU5ErkJggg==
"
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
let
localId
=
100
;
let
photo
=
'
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAAPCAYAAAA/I0V3AAAAAXNSR0IArs4c6QAAAARnQU1BAA
'
+
'
Cxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAACwSURBVDhPvZLBDYMwDEV/ugsXRjAT0EHCOuFIBwkbdIRewi6unbiAyoGgSn1SFH85+Y
'
+
'
q/4ljARW62X+LHS8uIzjm4dXUYF+utzBikB52Jo5e5iEPKqpACk7R9NM2RvWm5tIkD2czLCUFNKLD6IjdMHFHDzws285MgGrT0xCtp3WOKHo
'
+
'
+7q0mP0DZW9pNmoEFUzrQjp5cCnaen2kSJXLFD8ghbXyZCMQf/8e8Ns1XVAG/XAgqKzVnJFAAAAABJRU5ErkJggg==
'
accountManager
.
setOsAccountProfilePhoto
(
localId
,
photo
,
(
err
)
=>
{
console
.
log
(
"
setOsAccountProfilePhoto err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
'
setOsAccountProfilePhoto err:
'
+
JSON
.
stringify
(
err
));
});
```
...
...
@@ -1552,16 +1552,16 @@ setOsAccountProfilePhoto(localId: number, photo: string): Promise<void>
**示例:**
给ID为100的系统帐号设置头像
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
var
localId
=
100
;
var
photo
=
"
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAAPCAYAAAA/I0V3AAAAAXNSR0IArs4c6QAAAARnQU1BAA
"
+
"
Cxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAACwSURBVDhPvZLBDYMwDEV/ugsXRjAT0EHCOuFIBwkbdIRewi6unbiAyoGgSn1SFH85+Y
"
+
"
q/4ljARW62X+LHS8uIzjm4dXUYF+utzBikB52Jo5e5iEPKqpACk7R9NM2RvWm5tIkD2czLCUFNKLD6IjdMHFHDzws285MgGrT0xCtp3WOKHo
"
+
"
+7q0mP0DZW9pNmoEFUzrQjp5cCnaen2kSJXLFD8ghbXyZCMQf/8e8Ns1XVAG/XAgqKzVnJFAAAAABJRU5ErkJggg==
"
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
let
localId
=
100
;
let
photo
=
'
data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAAPCAYAAAA/I0V3AAAAAXNSR0IArs4c6QAAAARnQU1BAA
'
+
'
Cxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAACwSURBVDhPvZLBDYMwDEV/ugsXRjAT0EHCOuFIBwkbdIRewi6unbiAyoGgSn1SFH85+Y
'
+
'
q/4ljARW62X+LHS8uIzjm4dXUYF+utzBikB52Jo5e5iEPKqpACk7R9NM2RvWm5tIkD2czLCUFNKLD6IjdMHFHDzws285MgGrT0xCtp3WOKHo
'
+
'
+7q0mP0DZW9pNmoEFUzrQjp5cCnaen2kSJXLFD8ghbXyZCMQf/8e8Ns1XVAG/XAgqKzVnJFAAAAABJRU5ErkJggg==
'
accountManager
.
setOsAccountProfilePhoto
(
localId
,
photo
).
then
(()
=>
{
console
.
log
(
"
setOsAccountProfilePhoto success
"
);
console
.
log
(
'
setOsAccountProfilePhoto success
'
);
}).
catch
((
err
)
=>
{
console
.
log
(
"
setOsAccountProfilePhoto err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
'
setOsAccountProfilePhoto err:
'
+
JSON
.
stringify
(
err
));
});
```
...
...
@@ -1583,11 +1583,11 @@ getOsAccountLocalIdBySerialNumber(serialNumber: number, callback: AsyncCallback&
**示例:**
查询与SN码12345关联的系统帐号的ID
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
var
serialNumber
=
12345
;
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
let
serialNumber
=
12345
;
accountManager
.
getOsAccountLocalIdBySerialNumber
(
serialNumber
,
(
err
,
localId
)
=>
{
console
.
log
(
"
ger localId err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
"
get localId:
"
+
localId
+
"
by serialNumber:
"
+
serialNumber
);
console
.
log
(
'
ger localId err:
'
+
JSON
.
stringify
(
err
));
console
.
log
(
'
get localId:
'
+
localId
+
'
by serialNumber:
'
+
serialNumber
);
});
```
...
...
@@ -1614,12 +1614,12 @@ getOsAccountLocalIdBySerialNumber(serialNumber: number): Promise<number>
**示例:**
查询与SN码12345关联的系统帐号的ID
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
var
serialNumber
=
12345
;
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
let
serialNumber
=
12345
;
accountManager
.
getOsAccountLocalIdBySerialNumber
(
serialNumber
).
then
((
localId
)
=>
{
console
.
log
(
"
getOsAccountLocalIdBySerialNumber localId:
"
+
localId
);
console
.
log
(
'
getOsAccountLocalIdBySerialNumber localId:
'
+
localId
);
}).
catch
((
err
)
=>
{
console
.
log
(
"
getOsAccountLocalIdBySerialNumber err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
'
getOsAccountLocalIdBySerialNumber err:
'
+
JSON
.
stringify
(
err
));
});
```
...
...
@@ -1641,11 +1641,11 @@ getSerialNumberByOsAccountLocalId(localId: number, callback: AsyncCallback<nu
**示例:**
获取ID为100的系统帐号关联的SN码
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
var
localId
=
100
;
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
let
localId
=
100
;
accountManager
.
getSerialNumberByOsAccountLocalId
(
localId
,
(
err
,
serialNumber
)
=>
{
console
.
log
(
"
ger serialNumber err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
"
get serialNumber:
"
+
serialNumber
+
"
by localId:
"
+
localId
);
console
.
log
(
'
ger serialNumber err:
'
+
JSON
.
stringify
(
err
));
console
.
log
(
'
get serialNumber:
'
+
serialNumber
+
'
by localId:
'
+
localId
);
});
```
...
...
@@ -1672,12 +1672,12 @@ getSerialNumberByOsAccountLocalId(localId: number): Promise<number>
**示例:**
获取ID为100的系统帐号关联的SN码
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
var
localId
=
100
;
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
let
localId
=
100
;
accountManager
.
getSerialNumberByOsAccountLocalId
(
localId
).
then
((
serialNumber
)
=>
{
console
.
log
(
"
getSerialNumberByOsAccountLocalId serialNumber:
"
+
serialNumber
);
console
.
log
(
'
getSerialNumberByOsAccountLocalId serialNumber:
'
+
serialNumber
);
}).
catch
((
err
)
=>
{
console
.
log
(
"
getSerialNumberByOsAccountLocalId err:
"
+
JSON
.
stringify
(
err
));
console
.
log
(
'
getSerialNumberByOsAccountLocalId err:
'
+
JSON
.
stringify
(
err
));
});
```
...
...
@@ -1704,11 +1704,11 @@ on(type: 'activate' | 'activating', name: string, callback: Callback<number&g
**示例:**
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
function
onCallback
(
receiveLocalId
){
console
.
log
(
"
receive localId:
"
+
receiveLocalId
);
console
.
log
(
'
receive localId:
'
+
receiveLocalId
);
}
accountManager
.
on
(
"
activating
"
,
"
osAccountOnOffNameA
"
,
onCallback
);
accountManager
.
on
(
'
activating
'
,
'
osAccountOnOffNameA
'
,
onCallback
);
```
### off
...
...
@@ -1734,11 +1734,11 @@ off(type: 'activate' | 'activating', name: string, callback?: Callback<number
**示例:**
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
function
offCallback
(){
console
.
log
(
"
off enter
"
)
console
.
log
(
'
off enter
'
)
}
accountManager
.
off
(
"
activating
"
,
"
osAccountOnOffNameA
"
,
offCallback
);
accountManager
.
off
(
'
activating
'
,
'
osAccountOnOffNameA
'
,
offCallback
);
```
### getBundleIdFromUid<sup>9+</sup>
...
...
@@ -1761,11 +1761,11 @@ getBundleIdFromUid(uid: number, callback: AsyncCallback<number>): void;
**示例:**
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
var
testUid
=
1000000
;
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
let
testUid
=
1000000
;
accountManager
.
getBundleIdFromUid
(
testUid
,
(
err
,
bundleId
)
=>
{
console
.
info
(
"
getBundleIdFromUid errInfo:
"
+
JSON
.
stringify
(
err
));
console
.
info
(
"
getBundleIdFromUid bundleId:
"
+
JSON
.
stringify
(
bundleId
));
console
.
info
(
'
getBundleIdFromUid errInfo:
'
+
JSON
.
stringify
(
err
));
console
.
info
(
'
getBundleIdFromUid bundleId:
'
+
JSON
.
stringify
(
bundleId
));
});
```
### getBundleIdFromUid<sup>9+</sup>
...
...
@@ -1793,12 +1793,12 @@ getBundleIdFromUid(uid: number): Promise<number>;
**示例:**
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
var
testUid
=
1000000
;
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
let
testUid
=
1000000
;
accountManager
.
getBundleIdFromUid
(
testUid
).
then
((
result
)
=>
{
console
.
info
(
"
getBundleIdFromUid bundleId:
"
+
JSON
.
stringify
(
result
));
console
.
info
(
'
getBundleIdFromUid bundleId:
'
+
JSON
.
stringify
(
result
));
}).
catch
((
err
)
=>
{
console
.
info
(
"
getBundleIdFromUid errInfo:
"
+
JSON
.
stringify
(
err
));
console
.
info
(
'
getBundleIdFromUid errInfo:
'
+
JSON
.
stringify
(
err
));
});
```
...
...
@@ -1823,10 +1823,10 @@ isMainOsAccount(callback: AsyncCallback<boolean>): void;
**示例:**
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
accountManager
.
isMainOsAccount
((
err
,
result
)
=>
{
console
.
info
(
"
isMainOsAccount errInfo:
"
+
JSON
.
stringify
(
err
));
console
.
info
(
"
isMainOsAccount result:
"
+
JSON
.
stringify
(
result
));
console
.
info
(
'
isMainOsAccount errInfo:
'
+
JSON
.
stringify
(
err
));
console
.
info
(
'
isMainOsAccount result:
'
+
JSON
.
stringify
(
result
));
});
```
### isMainOsAccount<sup>9+</sup>
...
...
@@ -1850,11 +1850,11 @@ isMainOsAccount(): Promise<boolean>;
**示例:**
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
accountManager
.
isMainOsAccount
().
then
((
result
)
=>
{
console
.
info
(
"
isMainOsAccount result:
"
+
JSON
.
stringify
(
result
));
console
.
info
(
'
isMainOsAccount result:
'
+
JSON
.
stringify
(
result
));
}).
catch
((
err
)
=>
{
console
.
info
(
"
isMainOsAccount errInfo:
"
+
JSON
.
stringify
(
err
));
console
.
info
(
'
isMainOsAccount errInfo:
'
+
JSON
.
stringify
(
err
));
});
```
### queryOsAccountConstraintSourceTypes<sup>9+</sup>
...
...
@@ -1880,10 +1880,10 @@ queryOsAccountConstraintSourceTypes(localId: number, constraint: string, callbac
**示例:**
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
accountManager
.
queryOsAccountConstraintSourceTypes
(
100
,
"
constraint.wifi
"
,(
err
,
sourceTypeInfos
)
=>
{
console
.
info
(
"
queryOsAccountConstraintSourceType errInfo:
"
+
JSON
.
stringify
(
err
));
console
.
info
(
"
queryOsAccountConstraintSourceType sourceTypeInfos:
"
+
JSON
.
stringify
(
sourceTypeInfos
));
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
accountManager
.
queryOsAccountConstraintSourceTypes
(
100
,
'
constraint.wifi
'
,(
err
,
sourceTypeInfos
)
=>
{
console
.
info
(
'
queryOsAccountConstraintSourceType errInfo:
'
+
JSON
.
stringify
(
err
));
console
.
info
(
'
queryOsAccountConstraintSourceType sourceTypeInfos:
'
+
JSON
.
stringify
(
sourceTypeInfos
));
});
```
...
...
@@ -1915,11 +1915,11 @@ queryOsAccountConstraintSourceTypes(localId: number, constraint: string): Promis
**示例:**
```
js
cons
t
accountManager
=
account_osAccount
.
getAccountManager
();
accountManager
.
queryOsAccountConstraintSourceTypes
(
100
,
"
constraint.wifi
"
).
then
((
result
)
=>
{
console
.
info
(
"
queryOsAccountConstraintSourceType sourceTypeInfos:
"
+
JSON
.
stringify
(
result
));
le
t
accountManager
=
account_osAccount
.
getAccountManager
();
accountManager
.
queryOsAccountConstraintSourceTypes
(
100
,
'
constraint.wifi
'
).
then
((
result
)
=>
{
console
.
info
(
'
queryOsAccountConstraintSourceType sourceTypeInfos:
'
+
JSON
.
stringify
(
result
));
}).
catch
((
err
)
=>
{
console
.
info
(
"
queryOsAccountConstraintSourceType errInfo:
"
+
JSON
.
stringify
(
err
));
console
.
info
(
'
queryOsAccountConstraintSourceType errInfo:
'
+
JSON
.
stringify
(
err
));
});
```
...
...
@@ -1965,7 +1965,7 @@ getVersion(): number;
```
js
let
userAuth
=
new
account_osAccount
.
UserAuth
();
let
version
=
userAuth
.
getVersion
();
console
.
log
(
"
getVersion version =
"
+
version
);
console
.
log
(
'
getVersion version =
'
+
version
);
```
### getAvailableStatus<sup>8+</sup>
...
...
@@ -1999,7 +1999,7 @@ getAvailableStatus(authType: AuthType, authTrustLevel: AuthTrustLevel): number;
let
authType
=
account_osAccount
.
AuthType
.
PIN
;
let
authTrustLevel
=
account_osAccount
.
AuthTrustLevel
.
ATL1
;
let
status
=
userAuth
.
getAvailableStatus
(
authType
,
authTrustLevel
);
console
.
log
(
"
getAvailableStatus status =
"
+
status
);
console
.
log
(
'
getAvailableStatus status =
'
+
status
);
```
### getProperty<sup>8+</sup>
...
...
@@ -2034,8 +2034,8 @@ getProperty(request: GetPropertyRequest, callback: AsyncCallback<ExecutorProp
keys
:
keys
};
userAuth
.
getProperty
(
request
,
(
err
,
result
)
=>
{
console
.
log
(
"
getProperty err =
"
+
JSON
.
stringify
(
err
));
console
.
log
(
"
getProperty result =
"
+
JSON
.
stringify
(
result
));
console
.
log
(
'
getProperty err =
'
+
JSON
.
stringify
(
err
));
console
.
log
(
'
getProperty result =
'
+
JSON
.
stringify
(
result
));
});
```
...
...
@@ -2076,9 +2076,9 @@ getProperty(request: GetPropertyRequest): Promise<ExecutorProperty>;
keys
:
keys
};
userAuth
.
getProperty
(
request
).
then
((
result
)
=>
{
console
.
log
(
"
getProperty result =
"
+
JSON
.
stringify
(
result
));
console
.
log
(
'
getProperty result =
'
+
JSON
.
stringify
(
result
));
}).
catch
((
err
)
=>
{
console
.
log
(
"
getProperty error =
"
+
JSON
.
stringify
(
err
));
console
.
log
(
'
getProperty error =
'
+
JSON
.
stringify
(
err
));
});
```
...
...
@@ -2110,8 +2110,8 @@ setProperty(request: SetPropertyRequest, callback: AsyncCallback<number>):
setInfo
:
new
Uint8Array
([
0
])
};
userAuth
.
setProperty
(
request
,
(
err
,
result
)
=>
{
console
.
log
(
"
setProperty error =
"
+
JSON
.
stringify
(
err
));
console
.
log
(
"
setProperty result =
"
+
JSON
.
stringify
(
result
));
console
.
log
(
'
setProperty error =
'
+
JSON
.
stringify
(
err
));
console
.
log
(
'
setProperty result =
'
+
JSON
.
stringify
(
result
));
});
```
...
...
@@ -2148,9 +2148,9 @@ setProperty(request: SetPropertyRequest): Promise<number>;
setInfo
:
new
Uint8Array
([
0
])
};
userAuth
.
setProperty
(
request
).
then
((
result
)
=>
{
console
.
log
(
"
setProperty result =
"
+
JSON
.
stringify
(
result
));
console
.
log
(
'
setProperty result =
'
+
JSON
.
stringify
(
result
));
}).
catch
((
err
)
=>
{
console
.
log
(
"
setProperty error =
"
+
JSON
.
stringify
(
err
));
console
.
log
(
'
setProperty error =
'
+
JSON
.
stringify
(
err
));
});
```
...
...
@@ -2190,8 +2190,8 @@ auth(challenge: Uint8Array, authType: AuthType, authTrustLevel: AuthTrustLevel,
let
authTrustLevel
=
account_osAccount
.
AuthTrustLevel
.
ATL1
;
userAuth
.
auth
(
challenge
,
authType
,
authTrustLevel
,
{
onResult
:
function
(
result
,
extraInfo
){
console
.
log
(
"
auth result =
"
+
result
);
console
.
log
(
"
auth extraInfo =
"
+
JSON
.
stringify
(
extraInfo
));
console
.
log
(
'
auth result =
'
+
result
);
console
.
log
(
'
auth extraInfo =
'
+
JSON
.
stringify
(
extraInfo
));
}
});
```
...
...
@@ -2234,8 +2234,8 @@ authUser(userId: number, challenge: Uint8Array, authType: AuthType, authTrustLev
let
authTrustLevel
=
account_osAccount
.
AuthTrustLevel
.
ATL1
;
userAuth
.
authUser
(
userID
,
challenge
,
authType
,
authTrustLevel
,
{
onResult
:
function
(
result
,
extraInfo
){
console
.
log
(
"
authUser result =
"
+
result
);
console
.
log
(
"
authUser extraInfo =
"
+
JSON
.
stringify
(
extraInfo
));
console
.
log
(
'
authUser result =
'
+
result
);
console
.
log
(
'
authUser extraInfo =
'
+
JSON
.
stringify
(
extraInfo
));
}
});
```
...
...
@@ -2271,12 +2271,12 @@ cancelAuth(contextID: Uint8Array): number;
let
challenge
=
new
Uint8Array
([
0
]);
let
contextID
=
userAuth
.
auth
(
challenge
,
account_osAccount
.
AuthType
.
PIN
,
account_osAccount
.
AuthTrustLevel
.
ATL1
,
{
onResult
:
(
result
,
extraInfo
)
=>
{
console
.
log
(
"
auth result =
"
+
result
);
console
.
log
(
"
auth extraInfo =
"
+
JSON
.
stringify
(
extraInfo
));
console
.
log
(
'
auth result =
'
+
result
);
console
.
log
(
'
auth extraInfo =
'
+
JSON
.
stringify
(
extraInfo
));
}
});
let
result
=
userAuth
.
cancelAuth
(
contextID
);
console
.
log
(
"
cancelAuth result =
"
+
result
);
console
.
log
(
'
cancelAuth result =
'
+
result
);
```
## PINAuth<sup>8+</sup>
...
...
@@ -2333,7 +2333,7 @@ registerInputer(inputer: IInputer): boolean;
callback
.
onSetData
(
pinSubType
,
password
);
}
});
console
.
log
(
"
registerInputer result =
"
+
result
);
console
.
log
(
'
registerInputer result =
'
+
result
);
```
### unregisterInputer
...
...
@@ -2397,8 +2397,8 @@ openSession(callback: AsyncCallback<Uint8Array>): void;
```
js
let
userIDM
=
new
account_osAccount
.
UserIdentityManager
();
userIDM
.
openSession
((
err
,
challenge
)
=>
{
console
.
log
(
"
openSession error =
"
+
JSON
.
stringify
(
err
));
console
.
log
(
"
openSession challenge =
"
+
JSON
.
stringify
(
challenge
));
console
.
log
(
'
openSession error =
'
+
JSON
.
stringify
(
err
));
console
.
log
(
'
openSession challenge =
'
+
JSON
.
stringify
(
challenge
));
});
```
...
...
@@ -2424,9 +2424,9 @@ openSession(): Promise<Uint8Array>;
```
js
let
userIDM
=
new
account_osAccount
.
UserIdentityManager
();
userIDM
.
openSession
().
then
((
challenge
)
=>
{
console
.
info
(
"
openSession challenge =
"
+
JSON
.
stringify
(
challenge
));
console
.
info
(
'
openSession challenge =
'
+
JSON
.
stringify
(
challenge
));
}).
catch
((
err
)
=>
{
console
.
info
(
"
openSession error =
"
+
JSON
.
stringify
(
err
));
console
.
info
(
'
openSession error =
'
+
JSON
.
stringify
(
err
));
});
```
...
...
@@ -2467,8 +2467,8 @@ addCredential(credentialInfo: CredentialInfo, callback: IIdmCallback): void;
userIDM
.
openSession
((
err
,
challenge
)
=>
{
userIDM
.
addCredential
(
credentialInfo
,
{
onResult
:
(
result
,
extraInfo
)
=>
{
console
.
log
(
"
updateCredential result =
"
+
result
);
console
.
log
(
"
updateCredential extraInfo =
"
+
extraInfo
);
console
.
log
(
'
updateCredential result =
'
+
result
);
console
.
log
(
'
updateCredential extraInfo =
'
+
extraInfo
);
}
});
});
...
...
@@ -2518,8 +2518,8 @@ updateCredential(credentialInfo: CredentialInfo, callback: IIdmCallback): void;
credentialInfo
.
token
=
extraInfo
.
token
;
userIDM
.
updateCredential
(
credentialInfo
,
{
onResult
:
(
result
,
extraInfo
)
=>
{
console
.
log
(
"
updateCredential result =
"
+
result
);
console
.
log
(
"
updateCredential extraInfo =
"
+
extraInfo
);
console
.
log
(
'
updateCredential result =
'
+
result
);
console
.
log
(
'
updateCredential extraInfo =
'
+
extraInfo
);
}
});
}
...
...
@@ -2574,7 +2574,7 @@ cancel(challenge: Uint8Array): number;
let
userIDM
=
new
account_osAccount
.
UserIdentityManager
();
let
challenge
=
new
Uint8Array
([
0
]);
let
result
=
userIDM
.
cancel
(
challenge
);
console
.
log
(
"
cancel result:
"
+
result
);
console
.
log
(
'
cancel result:
'
+
result
);
```
### delUser<sup>8+</sup>
...
...
@@ -2602,8 +2602,8 @@ delUser(token: Uint8Array, callback: IIdmCallback): void;
let
token
=
new
Uint8Array
([
0
]);
userIDM
.
delUser
(
token
,
{
onResult
:
(
result
,
extraInfo
)
=>
{
console
.
log
(
"
delUser result =
"
+
result
);
console
.
log
(
"
delUser extraInfo =
"
+
JSON
.
stringify
(
extraInfo
));
console
.
log
(
'
delUser result =
'
+
result
);
console
.
log
(
'
delUser extraInfo =
'
+
JSON
.
stringify
(
extraInfo
));
}
});
```
...
...
@@ -2635,8 +2635,8 @@ delCred(credentialId: Uint8Array, token: Uint8Array, callback: IIdmCallback): vo
let
token
=
new
Uint8Array
([
0
]);
userIDM
.
delCred
(
credentialId
,
token
,
{
onResult
:
(
result
,
extraInfo
)
=>
{
console
.
log
(
"
delCred result =
"
+
result
);
console
.
log
(
"
delCred extraInfo =
"
+
JSON
.
stringify
(
extraInfo
));
console
.
log
(
'
delCred result =
'
+
result
);
console
.
log
(
'
delCred extraInfo =
'
+
JSON
.
stringify
(
extraInfo
));
}
});
```
...
...
@@ -2664,8 +2664,8 @@ getAuthInfo(callback: AsyncCallback<Array<EnrolledCredInfo>>): void;
```
js
let
userIDM
=
new
account_osAccount
.
UserIdentityManager
();
userIDM
.
getAuthInfo
((
err
,
result
)
=>
{
console
.
log
(
"
getAuthInfo err =
"
+
JSON
.
stringify
(
err
));
console
.
log
(
"
getAuthInfo result =
"
+
JSON
.
stringify
(
result
));
console
.
log
(
'
getAuthInfo err =
'
+
JSON
.
stringify
(
err
));
console
.
log
(
'
getAuthInfo result =
'
+
JSON
.
stringify
(
result
));
});
```
...
...
@@ -2692,8 +2692,8 @@ getAuthInfo(authType: AuthType, callback: AsyncCallback<Array<EnrolledCred
```
js
let
userIDM
=
new
account_osAccount
.
UserIdentityManager
();
userIDM
.
getAuthInfo
(
account_osAccount
.
AuthType
.
PIN
,
(
err
,
result
)
=>
{
console
.
log
(
"
getAuthInfo err =
"
+
JSON
.
stringify
(
err
));
console
.
log
(
"
getAuthInfo result =
"
+
JSON
.
stringify
(
result
));
console
.
log
(
'
getAuthInfo err =
'
+
JSON
.
stringify
(
err
));
console
.
log
(
'
getAuthInfo result =
'
+
JSON
.
stringify
(
result
));
});
```
...
...
@@ -2725,9 +2725,9 @@ getAuthInfo(authType?: AuthType): Promise<Array<EnrolledCredInfo>>;
```
js
let
userIDM
=
new
account_osAccount
.
UserIdentityManager
();
userIDM
.
getAuthInfo
(
account_osAccount
.
AuthType
.
PIN
).
then
((
result
)
=>
{
console
.
log
(
"
getAuthInfo result =
"
+
JSON
.
stringify
(
result
))
console
.
log
(
'
getAuthInfo result =
'
+
JSON
.
stringify
(
result
))
}).
catch
((
err
)
=>
{
console
.
log
(
"
getAuthInfo error =
"
+
JSON
.
stringify
(
err
));
console
.
log
(
'
getAuthInfo error =
'
+
JSON
.
stringify
(
err
));
});
```
...
...
@@ -2806,7 +2806,7 @@ onGetData: (pinSubType: AuthSubType, callback: IInputData) => void;
};
let
pinAuth
=
new
account_osAccount
.
PINAuth
();
let
result
=
pinAuth
.
registerInputer
(
inputer
);
console
.
log
(
"
registerInputer result:
"
+
result
);
console
.
log
(
'
registerInputer result:
'
+
result
);
```
## IUserAuthCallback<sup>8+</sup>
...
...
@@ -2836,8 +2836,8 @@ onResult: (result: number, extraInfo: AuthResult) => void;
```
js
let
authCallback
=
{
onResult
:
(
result
,
extraInfo
)
=>
{
console
.
log
(
"
auth result =
"
+
result
);
console
.
log
(
"
auth extraInfo =
"
+
JSON
.
stringify
(
extraInfo
));
console
.
log
(
'
auth result =
'
+
result
);
console
.
log
(
'
auth extraInfo =
'
+
JSON
.
stringify
(
extraInfo
));
}
};
```
...
...
@@ -2864,12 +2864,12 @@ onAcquireInfo?: (module: number, acquire: number, extraInfo: any) => void;
```
js
let
authCallback
=
{
onResult
:
(
result
,
extraInfo
)
=>
{
console
.
log
(
"
auth result =
"
+
result
)
console
.
log
(
"
auth extraInfo =
"
+
JSON
.
stringify
(
extraInfo
));
console
.
log
(
'
auth result =
'
+
result
)
console
.
log
(
'
auth extraInfo =
'
+
JSON
.
stringify
(
extraInfo
));
},
onAcquireInfo
:
(
module
,
acquire
,
extraInfo
)
=>
{
console
.
log
(
"
auth module =
"
+
module
);
console
.
log
(
"
auth acquire =
"
+
acquire
);
console
.
log
(
'
auth module =
'
+
module
);
console
.
log
(
'
auth acquire =
'
+
acquire
);
console
.
info
(
'
auth extraInfo =
'
+
JSON
.
stringify
(
extraInfo
));
}
};
...
...
@@ -2900,9 +2900,9 @@ onResult: (result: number, extraInfo: RequestResult) => void;
**示例:**
```
js
var
idmCallback
=
{
let
idmCallback
=
{
onResult
:
(
result
,
extraInfo
)
=>
{
console
.
log
(
"
callback result =
"
+
result
)
console
.
log
(
'
callback result =
'
+
result
)
console
.
info
(
'
callback extraInfo =
'
+
JSON
.
stringify
(
extraInfo
));
}
};
...
...
@@ -2930,12 +2930,12 @@ onAcquireInfo?: (module: number, acquire: number, extraInfo: any) => void;
```
js
let
idmCallback
=
{
onResult
:
(
result
,
extraInfo
)
=>
{
console
.
log
(
"
callback result =
"
+
result
)
console
.
log
(
"
callback onResult =
"
+
JSON
.
stringify
(
extraInfo
));
console
.
log
(
'
callback result =
'
+
result
)
console
.
log
(
'
callback onResult =
'
+
JSON
.
stringify
(
extraInfo
));
},
onAcquireInfo
:
(
module
,
acquire
,
extraInfo
)
=>
{
console
.
log
(
"
callback module =
"
+
module
);
console
.
log
(
"
callback acquire =
"
+
acquire
);
console
.
log
(
'
callback module =
'
+
module
);
console
.
log
(
'
callback acquire =
'
+
acquire
);
console
.
log
(
'
callback onacquireinfo =
'
+
JSON
.
stringify
(
extraInfo
));
}
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录