Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
522316cc
D
Docs
项目概览
OpenHarmony
/
Docs
10 个月 前同步成功
通知
158
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
522316cc
编写于
7月 11, 2023
作者:
C
cclicn
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
【帐号iam】js接口资料错误码补充
Signed-off-by:
N
cclicn
<
lichenchen22@huawei.com
>
上级
65afc80b
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
55 addition
and
7 deletion
+55
-7
zh-cn/application-dev/reference/apis/js-apis-appAccount.md
zh-cn/application-dev/reference/apis/js-apis-appAccount.md
+2
-2
zh-cn/application-dev/reference/apis/js-apis-osAccount.md
zh-cn/application-dev/reference/apis/js-apis-osAccount.md
+53
-5
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-appAccount.md
浏览文件 @
522316cc
...
...
@@ -1559,7 +1559,7 @@ setAuthToken(name: string, authType: string, token: string, callback: AsyncCallb
| 12300001 | System service exception. |
| 12300002 | Invalid name, authType or token. |
| 12300003 | Account not found. |
| 12400004 | The number of token reaches the upper limit. |
| 12400004 | The number of token
s
reaches the upper limit. |
**示例:**
...
...
@@ -1606,7 +1606,7 @@ setAuthToken(name: string, authType: string, token: string): Promise<void>
| 12300001 | System service exception. |
| 12300002 | Invalid name, authType or token. |
| 12300003 | Account not found. |
| 12400004 | The number of token reaches the upper limit. |
| 12400004 | The number of token
s
reaches the upper limit. |
**示例:**
...
...
zh-cn/application-dev/reference/apis/js-apis-osAccount.md
浏览文件 @
522316cc
...
...
@@ -595,6 +595,41 @@ checkOsAccountVerified(localId: number): Promise<boolean>
}
```
### checkOsAccountVerified<sup>9+</sup>
checkOsAccountVerified(): Promise
<
boolean
>
检查当前系统帐号是否已验证。使用Promise异步回调。
**系统能力:**
SystemCapability.Account.OsAccount
**返回值:**
| 类型 | 说明 |
| ---------------------- | ----------------------------------------------------------------- |
| Promise
<
boolean
>
| Promise对象。返回true表示当前帐号已验证;返回false表示当前帐号未验证。 |
**错误码:**
| 错误码ID | 错误信息 |
| -------- | ------------------- |
| 12300001 | System service exception. |
**示例:**
```
js
let
accountManager
=
account_osAccount
.
getAccountManager
();
try
{
accountManager
.
checkOsAccountVerified
().
then
((
isVerified
)
=>
{
console
.
log
(
'
checkOsAccountVerified successfully, isVerified:
'
+
isVerified
);
}).
catch
((
err
)
=>
{
console
.
log
(
'
checkOsAccountVerified failed, error:
'
+
JSON
.
stringify
(
err
));
});
}
catch
(
err
)
{
console
.
log
(
'
checkOsAccountVerified exception:
'
+
JSON
.
stringify
(
err
));
}
```
### removeOsAccount
removeOsAccount(localId: number, callback: AsyncCallback
<
void
>
): void
...
...
@@ -1552,7 +1587,7 @@ createOsAccount(localName: string, type: OsAccountType, callback: AsyncCallback&
| 12300002 | Invalid localName or type. |
| 12300005 | Multi-user not supported. |
| 12300006 | Unsupported account type. |
| 12300007 | The number of account reaches the upper limit. |
| 12300007 | The number of account
s
reaches the upper limit. |
**示例:**
...
...
@@ -1601,7 +1636,7 @@ createOsAccount(localName: string, type: OsAccountType): Promise<OsAccountInf
| 12300002 | Invalid localName or type. |
| 12300005 | Multi-user not supported. |
| 12300006 | Unsupported account type. |
| 12300007 | The number of account reaches the upper limit. |
| 12300007 | The number of account
s
reaches the upper limit. |
**示例:**
...
...
@@ -1646,7 +1681,7 @@ createOsAccountForDomain(type: OsAccountType, domainInfo: DomainAccountInfo, cal
| 12300002 | Invalid type or domainInfo. |
| 12300005 | Multi-user not supported. |
| 12300006 | Unsupported account type. |
| 12300007 | The number of account reaches the upper limit. |
| 12300007 | The number of account
s
reaches the upper limit. |
**示例:**
...
...
@@ -1696,7 +1731,7 @@ createOsAccountForDomain(type: OsAccountType, domainInfo: DomainAccountInfo): Pr
| 12300002 | Invalid type or domainInfo. |
| 12300005 | Multi-user not supported. |
| 12300006 | Unsupported account type. |
| 12300007 | The number of account reaches the upper limit. |
| 12300007 | The number of account
s
reaches the upper limit. |
**示例:**
...
...
@@ -4109,8 +4144,10 @@ auth(challenge: Uint8Array, authType: AuthType, authTrustLevel: AuthTrustLevel,
| 12300001 | System service exception. |
| 12300002 | Invalid challenge, authType or authTrustLevel. |
| 12300101 | Credential is incorrect. |
| 12300102 | Credential not enrolled. |
| 12300105 | Unsupported authTrustLevel. |
| 12300106 | Unsupported authType. |
| 12300109 | Authentication is canceled. |
| 12300110 | Authentication is locked. |
| 12300111 | Authentication timeout. |
| 12300112 | Authentication service is busy. |
...
...
@@ -4168,8 +4205,10 @@ authUser(userId: number, challenge: Uint8Array, authType: AuthType, authTrustLev
| 12300001 | System service exception. |
| 12300002 | Invalid userId, challenge, authType or authTrustLevel. |
| 12300101 | Credential is incorrect. |
| 12300102 | Credential not enrolled. |
| 12300105 | Unsupported authTrustLevel. |
| 12300106 | Unsupported authType. |
| 12300109 | Authentication is canceled. |
| 12300110 | Authentication is locked. |
| 12300111 | Authentication timeout. |
| 12300112 | Authentication service is busy. |
...
...
@@ -5319,6 +5358,9 @@ addCredential(credentialInfo: CredentialInfo, callback: IIdmCallback): void;
| 12300002 | Invalid credentialInfo, i.e. authType or authSubType. |
| 12300101 | Token is invalid. |
| 12300106 | Unsupported authType. |
| 12300109 | Operation is canceled. |
| 12300111 | Operation timeout. |
| 12300115 | The number of credentials reaches the upper limit. |
**示例:**
```
js
...
...
@@ -5375,7 +5417,10 @@ updateCredential(credentialInfo: CredentialInfo, callback: IIdmCallback): void;
| 12300001 | System service exception. |
| 12300002 | Invalid credentialInfo, i.e. authType or authSubType or token. |
| 12300101 | Token is invalid. |
| 12300102 | Credential not enrolled.|
| 12300106 | Unsupported authType. |
| 12300109 | Operation is canceled. |
| 12300111 | Operation timeout. |
**示例:**
```
js
...
...
@@ -5538,7 +5583,7 @@ delCred(credentialId: Uint8Array, token: Uint8Array, callback: IIdmCallback): vo
| 12300001 | System service exception. |
| 12300002 | Invalid credentialId. |
| 12300101 | Token is invalid. |
| 12300102 | Credential not
foun
d. |
| 12300102 | Credential not
enrolle
d. |
**示例:**
```
js
...
...
@@ -5580,6 +5625,7 @@ getAuthInfo(callback: AsyncCallback<Array<EnrolledCredInfo>>): void;
| 错误码ID | 错误信息 |
| -------- | --------------------- |
| 12300001 | System service exception. |
| 12300102 | Credential not enrolled. |
**示例:**
```
js
...
...
@@ -5619,6 +5665,7 @@ getAuthInfo(authType: AuthType, callback: AsyncCallback<Array<EnrolledCred
| -------- | ------------------- |
| 12300001 | System service exception. |
| 12300002 | Invalid authType. |
| 12300102 | Credential not enrolled. |
**示例:**
```
js
...
...
@@ -5663,6 +5710,7 @@ getAuthInfo(authType?: AuthType): Promise<Array<EnrolledCredInfo>>;
| -------- | ------------------- |
| 12300001 | System service exception. |
| 12300002 | Invalid authType. |
| 12300102 | Credential not enrolled. |
**示例:**
```
js
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录