Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
71457975
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看板
提交
71457975
编写于
9月 06, 2023
作者:
C
cc_ggboy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
account arkts告警清理
Signed-off-by:
N
cc_ggboy
<
chenweimin8@huawei.com
>
上级
ba0e70f1
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
25 addition
and
31 deletion
+25
-31
zh-cn/application-dev/reference/apis/js-apis-osAccount.md
zh-cn/application-dev/reference/apis/js-apis-osAccount.md
+25
-31
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-osAccount.md
浏览文件 @
71457975
...
...
@@ -90,9 +90,7 @@ activateOsAccount(localId: number, callback: AsyncCallback<void>): void
}
});
}
catch
(
err
)
{
let
code
=
(
err
as
BusinessError
).
code
let
message
=
(
err
as
BusinessError
).
message
console
.
error
(
`activateOsAccount failed, code is
${
code
}
, message is
${
message
}
`
);
console
.
log
(
'
activateOsAccount failed, error:
'
+
JSON
.
stringify
(
err
));
}
```
...
...
@@ -180,9 +178,7 @@ checkMultiOsAccountEnabled(callback: AsyncCallback<boolean>): void
}
});
}
catch
(
err
)
{
let
code
=
(
err
as
BusinessError
).
code
let
message
=
(
err
as
BusinessError
).
message
console
.
error
(
`checkMultiOsAccountEnabled failed, code is
${
code
}
, message is
${
message
}
`
);
console
.
log
(
'
checkMultiOsAccountEnabled failed, error:
'
+
JSON
.
stringify
(
err
));
}
```
...
...
@@ -218,9 +214,7 @@ checkMultiOsAccountEnabled(): Promise<boolean>
console
.
error
(
`checkMultiOsAccountEnabled failed, code is
${
err
.
code
}
, message is
${
err
.
message
}
`
);
});
}
catch
(
err
)
{
let
code
=
(
err
as
BusinessError
).
code
let
message
=
(
err
as
BusinessError
).
message
console
.
error
(
`checkMultiOsAccountEnabled failed, code is
${
code
}
, message is
${
message
}
`
);
console
.
log
(
'
checkMultiOsAccountEnabled failed, error:
'
+
JSON
.
stringify
(
err
));
}
```
...
...
@@ -3544,7 +3538,7 @@ getOsAccountLocalIdFromDomain(domainInfo: DomainAccountInfo, callback: AsyncCall
```
ts
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
domainInfo
=
{
domain
:
'
testDomain
'
,
accountName
:
'
testAccountName
'
};
let
domainInfo
:
account_osAccount
.
DomainAccountInfo
=
{
domain
:
'
testDomain
'
,
accountName
:
'
testAccountName
'
};
let
accountManager
=
account_osAccount
.
getAccountManager
();
accountManager
.
getOsAccountLocalIdFromDomain
(
domainInfo
,
(
err
:
BusinessError
,
localId
:
number
)
=>
{
if
(
err
)
{
...
...
@@ -3586,7 +3580,7 @@ getOsAccountLocalIdFromDomain(domainInfo: DomainAccountInfo): Promise<number&
```
ts
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
accountManager
=
account_osAccount
.
getAccountManager
();
let
domainInfo
=
{
domain
:
'
testDomain
'
,
accountName
:
'
testAccountName
'
};
let
domainInfo
:
account_osAccount
.
DomainAccountInfo
=
{
domain
:
'
testDomain
'
,
accountName
:
'
testAccountName
'
};
accountManager
.
getOsAccountLocalIdFromDomain
(
domainInfo
).
then
((
localId
:
number
)
=>
{
console
.
log
(
'
getOsAccountLocalIdFromDomain successfully, localId:
'
+
localId
);
}).
catch
((
err
:
BusinessError
)
=>
{
...
...
@@ -4128,10 +4122,10 @@ getAvailableStatus(authType: AuthType, authTrustLevel: AuthTrustLevel): number;
**示例:**
```
ts
let
userAuth
=
new
account_osAccount
.
UserAuth
();
let
authType
=
account_osAccount
.
AuthType
.
PIN
;
let
authTrustLevel
=
account_osAccount
.
AuthTrustLevel
.
ATL1
;
let
authType
:
account_osAccount
.
AuthType
=
account_osAccount
.
AuthType
.
PIN
;
let
authTrustLevel
:
account_osAccount
.
AuthTrustLevel
=
account_osAccount
.
AuthTrustLevel
.
ATL1
;
try
{
let
status
=
userAuth
.
getAvailableStatus
(
authType
,
authTrustLevel
);
let
status
:
number
=
userAuth
.
getAvailableStatus
(
authType
,
authTrustLevel
);
console
.
log
(
'
getAvailableStatus status =
'
+
status
);
}
catch
(
e
)
{
console
.
log
(
'
getAvailableStatus exception =
'
+
JSON
.
stringify
(
e
));
...
...
@@ -4168,7 +4162,7 @@ getProperty(request: GetPropertyRequest, callback: AsyncCallback<ExecutorProp
```
ts
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
userAuth
=
new
account_osAccount
.
UserAuth
();
let
keys
=
[
let
keys
:
Array
<
account_osAccount
.
GetPropertyType
>
=
[
account_osAccount
.
GetPropertyType
.
AUTH_SUB_TYPE
,
account_osAccount
.
GetPropertyType
.
REMAIN_TIMES
,
account_osAccount
.
GetPropertyType
.
FREEZING_TIME
...
...
@@ -4222,7 +4216,7 @@ getProperty(request: GetPropertyRequest): Promise<ExecutorProperty>;
```
ts
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
userAuth
=
new
account_osAccount
.
UserAuth
();
let
keys
=
[
let
keys
:
Array
<
account_osAccount
.
GetPropertyType
>
=
[
account_osAccount
.
GetPropertyType
.
AUTH_SUB_TYPE
,
account_osAccount
.
GetPropertyType
.
REMAIN_TIMES
,
account_osAccount
.
GetPropertyType
.
FREEZING_TIME
...
...
@@ -4325,13 +4319,13 @@ setProperty(request: SetPropertyRequest): Promise<void>;
```
ts
import
{
BusinessError
}
from
'
@ohos.base
'
;
let
userAuth
=
new
account_osAccount
.
UserAuth
();
let
request
2
:
account_osAccount
.
SetPropertyRequest
=
{
let
request
:
account_osAccount
.
SetPropertyRequest
=
{
authType
:
account_osAccount
.
AuthType
.
PIN
,
key
:
account_osAccount
.
SetPropertyType
.
INIT_ALGORITHM
,
setInfo
:
new
Uint8Array
([
0
])
};
try
{
userAuth
.
setProperty
(
request
2
).
then
(()
=>
{
userAuth
.
setProperty
(
request
).
then
(()
=>
{
console
.
log
(
'
setProperty successfully
'
);
}).
catch
((
err
:
BusinessError
)
=>
{
console
.
log
(
'
setProperty failed, error =
'
+
JSON
.
stringify
(
err
));
...
...
@@ -4386,12 +4380,12 @@ auth(challenge: Uint8Array, authType: AuthType, authTrustLevel: AuthTrustLevel,
**示例:**
```
ts
let
userAuth
=
new
account_osAccount
.
UserAuth
();
let
challenge
=
new
Uint8Array
([
0
]);
let
authType
=
account_osAccount
.
AuthType
.
PIN
;
let
authTrustLevel
=
account_osAccount
.
AuthTrustLevel
.
ATL1
;
let
challenge
:
Uint8Array
=
new
Uint8Array
([
0
]);
let
authType
:
account_osAccount
.
AuthType
=
account_osAccount
.
AuthType
.
PIN
;
let
authTrustLevel
:
account_osAccount
.
AuthTrustLevel
=
account_osAccount
.
AuthTrustLevel
.
ATL1
;
try
{
userAuth
.
auth
(
challenge
,
authType
,
authTrustLevel
,
{
onResult
:
(
result
,
extraInfo
)
=>
{
onResult
:
(
result
:
number
,
extraInfo
:
account_osAccount
.
AuthResult
)
=>
{
console
.
log
(
'
auth result =
'
+
result
);
console
.
log
(
'
auth extraInfo =
'
+
JSON
.
stringify
(
extraInfo
));
}
...
...
@@ -4448,9 +4442,9 @@ authUser(userId: number, challenge: Uint8Array, authType: AuthType, authTrustLev
```
ts
let
userAuth
=
new
account_osAccount
.
UserAuth
();
let
userID
:
number
=
100
;
let
challenge
=
new
Uint8Array
([
0
]);
let
authType
=
account_osAccount
.
AuthType
.
PIN
;
let
authTrustLevel
=
account_osAccount
.
AuthTrustLevel
.
ATL1
;
let
challenge
:
Uint8Array
=
new
Uint8Array
([
0
]);
let
authType
:
account_osAccount
.
AuthType
=
account_osAccount
.
AuthType
.
PIN
;
let
authTrustLevel
:
account_osAccount
.
AuthTrustLevel
=
account_osAccount
.
AuthTrustLevel
.
ATL1
;
try
{
userAuth
.
authUser
(
userID
,
challenge
,
authType
,
authTrustLevel
,
{
onResult
:
(
result
,
extraInfo
)
=>
{
...
...
@@ -4493,7 +4487,7 @@ cancelAuth(contextID: Uint8Array): void;
let
userAuth
=
new
account_osAccount
.
UserAuth
();
let
pinAuth
:
account_osAccount
.
PINAuth
=
new
account_osAccount
.
PINAuth
();
let
challenge
=
new
Uint8Array
([
0
]);
let
contextId
=
userAuth
.
auth
(
challenge
,
account_osAccount
.
AuthType
.
PIN
,
account_osAccount
.
AuthTrustLevel
.
ATL1
,
{
let
contextId
:
Uint8Array
=
userAuth
.
auth
(
challenge
,
account_osAccount
.
AuthType
.
PIN
,
account_osAccount
.
AuthTrustLevel
.
ATL1
,
{
onResult
:
(
result
:
number
,
extraInfo
:
account_osAccount
.
AuthResult
)
=>
{
console
.
log
(
'
auth result =
'
+
result
);
console
.
log
(
'
auth extraInfo =
'
+
JSON
.
stringify
(
extraInfo
));
...
...
@@ -4621,7 +4615,7 @@ static registerInputer(authType: AuthType, inputer: IInputer): void
**示例:**
```
ts
let
authType
=
account_osAccount
.
AuthType
.
DOMAIN
;
let
authType
:
account_osAccount
.
AuthType
=
account_osAccount
.
AuthType
.
DOMAIN
;
let
password
:
Uint8Array
=
new
Uint8Array
([
0
,
0
,
0
,
0
,
0
]);
try
{
account_osAccount
.
InputerManager
.
registerInputer
(
authType
,
{
...
...
@@ -4661,7 +4655,7 @@ static unregisterInputer(authType: AuthType): void
**示例:**
```
ts
let
authType
=
account_osAccount
.
AuthType
.
DOMAIN
;
let
authType
:
account_osAccount
.
AuthType
=
account_osAccount
.
AuthType
.
DOMAIN
;
try
{
account_osAccount
.
InputerManager
.
unregisterInputer
(
authType
);
console
.
log
(
'
unregisterInputer success.
'
);
...
...
@@ -4726,9 +4720,9 @@ auth(domainAccountInfo: DomainAccountInfo, credential: Uint8Array, callback: IUs
}
account_osAccount
.
DomainAccountManager
.
registerPlugin
(
plugin
);
let
userAuth
=
new
account_osAccount
.
UserAuth
();
let
challenge
=
new
Uint8Array
([
0
]);
let
authType
=
account_osAccount
.
AuthType
.
DOMAIN
;
let
authTrustLevel
=
account_osAccount
.
AuthTrustLevel
.
ATL1
;
let
challenge
:
Uint8Array
=
new
Uint8Array
([
0
]);
let
authType
:
account_osAccount
.
AuthType
=
account_osAccount
.
AuthType
.
DOMAIN
;
let
authTrustLevel
:
account_osAccount
.
AuthTrustLevel
=
account_osAccount
.
AuthTrustLevel
.
ATL1
;
try
{
userAuth
.
auth
(
challenge
,
authType
,
authTrustLevel
,
{
onResult
:
(
resultCode
:
number
,
authResult
:
account_osAccount
.
AuthResult
)
=>
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录