Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
85aa6307
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看板
未验证
提交
85aa6307
编写于
7月 19, 2023
作者:
O
openharmony_ci
提交者:
Gitee
7月 19, 2023
浏览文件
操作
浏览文件
下载
差异文件
!20749 js接口资料错误码补充以及一致性问题修改
Merge pull request !20749 from lichenchen/master
上级
364a0168
522316cc
变更
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
浏览文件 @
85aa6307
...
@@ -1559,7 +1559,7 @@ setAuthToken(name: string, authType: string, token: string, callback: AsyncCallb
...
@@ -1559,7 +1559,7 @@ setAuthToken(name: string, authType: string, token: string, callback: AsyncCallb
| 12300001 | System service exception. |
| 12300001 | System service exception. |
| 12300002 | Invalid name, authType or token. |
| 12300002 | Invalid name, authType or token. |
| 12300003 | Account not found. |
| 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>
...
@@ -1606,7 +1606,7 @@ setAuthToken(name: string, authType: string, token: string): Promise<void>
| 12300001 | System service exception. |
| 12300001 | System service exception. |
| 12300002 | Invalid name, authType or token. |
| 12300002 | Invalid name, authType or token. |
| 12300003 | Account not found. |
| 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
浏览文件 @
85aa6307
...
@@ -630,6 +630,41 @@ checkOsAccountVerified(localId: number): Promise<boolean>
...
@@ -630,6 +630,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
removeOsAccount(localId: number, callback: AsyncCallback
<
void
>
): void
removeOsAccount(localId: number, callback: AsyncCallback
<
void
>
): void
...
@@ -1587,7 +1622,7 @@ createOsAccount(localName: string, type: OsAccountType, callback: AsyncCallback&
...
@@ -1587,7 +1622,7 @@ createOsAccount(localName: string, type: OsAccountType, callback: AsyncCallback&
| 12300002 | Invalid localName or type. |
| 12300002 | Invalid localName or type. |
| 12300005 | Multi-user not supported. |
| 12300005 | Multi-user not supported. |
| 12300006 | Unsupported account type. |
| 12300006 | Unsupported account type. |
| 12300007 | The number of account reaches the upper limit. |
| 12300007 | The number of account
s
reaches the upper limit. |
**示例:**
**示例:**
...
@@ -1636,7 +1671,7 @@ createOsAccount(localName: string, type: OsAccountType): Promise<OsAccountInf
...
@@ -1636,7 +1671,7 @@ createOsAccount(localName: string, type: OsAccountType): Promise<OsAccountInf
| 12300002 | Invalid localName or type. |
| 12300002 | Invalid localName or type. |
| 12300005 | Multi-user not supported. |
| 12300005 | Multi-user not supported. |
| 12300006 | Unsupported account type. |
| 12300006 | Unsupported account type. |
| 12300007 | The number of account reaches the upper limit. |
| 12300007 | The number of account
s
reaches the upper limit. |
**示例:**
**示例:**
...
@@ -1681,7 +1716,7 @@ createOsAccountForDomain(type: OsAccountType, domainInfo: DomainAccountInfo, cal
...
@@ -1681,7 +1716,7 @@ createOsAccountForDomain(type: OsAccountType, domainInfo: DomainAccountInfo, cal
| 12300002 | Invalid type or domainInfo. |
| 12300002 | Invalid type or domainInfo. |
| 12300005 | Multi-user not supported. |
| 12300005 | Multi-user not supported. |
| 12300006 | Unsupported account type. |
| 12300006 | Unsupported account type. |
| 12300007 | The number of account reaches the upper limit. |
| 12300007 | The number of account
s
reaches the upper limit. |
**示例:**
**示例:**
...
@@ -1731,7 +1766,7 @@ createOsAccountForDomain(type: OsAccountType, domainInfo: DomainAccountInfo): Pr
...
@@ -1731,7 +1766,7 @@ createOsAccountForDomain(type: OsAccountType, domainInfo: DomainAccountInfo): Pr
| 12300002 | Invalid type or domainInfo. |
| 12300002 | Invalid type or domainInfo. |
| 12300005 | Multi-user not supported. |
| 12300005 | Multi-user not supported. |
| 12300006 | Unsupported account type. |
| 12300006 | Unsupported account type. |
| 12300007 | The number of account reaches the upper limit. |
| 12300007 | The number of account
s
reaches the upper limit. |
**示例:**
**示例:**
...
@@ -4144,8 +4179,10 @@ auth(challenge: Uint8Array, authType: AuthType, authTrustLevel: AuthTrustLevel,
...
@@ -4144,8 +4179,10 @@ auth(challenge: Uint8Array, authType: AuthType, authTrustLevel: AuthTrustLevel,
| 12300001 | System service exception. |
| 12300001 | System service exception. |
| 12300002 | Invalid challenge, authType or authTrustLevel. |
| 12300002 | Invalid challenge, authType or authTrustLevel. |
| 12300101 | Credential is incorrect. |
| 12300101 | Credential is incorrect. |
| 12300102 | Credential not enrolled. |
| 12300105 | Unsupported authTrustLevel. |
| 12300105 | Unsupported authTrustLevel. |
| 12300106 | Unsupported authType. |
| 12300106 | Unsupported authType. |
| 12300109 | Authentication is canceled. |
| 12300110 | Authentication is locked. |
| 12300110 | Authentication is locked. |
| 12300111 | Authentication timeout. |
| 12300111 | Authentication timeout. |
| 12300112 | Authentication service is busy. |
| 12300112 | Authentication service is busy. |
...
@@ -4203,8 +4240,10 @@ authUser(userId: number, challenge: Uint8Array, authType: AuthType, authTrustLev
...
@@ -4203,8 +4240,10 @@ authUser(userId: number, challenge: Uint8Array, authType: AuthType, authTrustLev
| 12300001 | System service exception. |
| 12300001 | System service exception. |
| 12300002 | Invalid userId, challenge, authType or authTrustLevel. |
| 12300002 | Invalid userId, challenge, authType or authTrustLevel. |
| 12300101 | Credential is incorrect. |
| 12300101 | Credential is incorrect. |
| 12300102 | Credential not enrolled. |
| 12300105 | Unsupported authTrustLevel. |
| 12300105 | Unsupported authTrustLevel. |
| 12300106 | Unsupported authType. |
| 12300106 | Unsupported authType. |
| 12300109 | Authentication is canceled. |
| 12300110 | Authentication is locked. |
| 12300110 | Authentication is locked. |
| 12300111 | Authentication timeout. |
| 12300111 | Authentication timeout. |
| 12300112 | Authentication service is busy. |
| 12300112 | Authentication service is busy. |
...
@@ -5354,6 +5393,9 @@ addCredential(credentialInfo: CredentialInfo, callback: IIdmCallback): void;
...
@@ -5354,6 +5393,9 @@ addCredential(credentialInfo: CredentialInfo, callback: IIdmCallback): void;
| 12300002 | Invalid credentialInfo, i.e. authType or authSubType. |
| 12300002 | Invalid credentialInfo, i.e. authType or authSubType. |
| 12300101 | Token is invalid. |
| 12300101 | Token is invalid. |
| 12300106 | Unsupported authType. |
| 12300106 | Unsupported authType. |
| 12300109 | Operation is canceled. |
| 12300111 | Operation timeout. |
| 12300115 | The number of credentials reaches the upper limit. |
**示例:**
**示例:**
```
js
```
js
...
@@ -5410,7 +5452,10 @@ updateCredential(credentialInfo: CredentialInfo, callback: IIdmCallback): void;
...
@@ -5410,7 +5452,10 @@ updateCredential(credentialInfo: CredentialInfo, callback: IIdmCallback): void;
| 12300001 | System service exception. |
| 12300001 | System service exception. |
| 12300002 | Invalid credentialInfo, i.e. authType or authSubType or token. |
| 12300002 | Invalid credentialInfo, i.e. authType or authSubType or token. |
| 12300101 | Token is invalid. |
| 12300101 | Token is invalid. |
| 12300102 | Credential not enrolled.|
| 12300106 | Unsupported authType. |
| 12300106 | Unsupported authType. |
| 12300109 | Operation is canceled. |
| 12300111 | Operation timeout. |
**示例:**
**示例:**
```
js
```
js
...
@@ -5573,7 +5618,7 @@ delCred(credentialId: Uint8Array, token: Uint8Array, callback: IIdmCallback): vo
...
@@ -5573,7 +5618,7 @@ delCred(credentialId: Uint8Array, token: Uint8Array, callback: IIdmCallback): vo
| 12300001 | System service exception. |
| 12300001 | System service exception. |
| 12300002 | Invalid credentialId. |
| 12300002 | Invalid credentialId. |
| 12300101 | Token is invalid. |
| 12300101 | Token is invalid. |
| 12300102 | Credential not
foun
d. |
| 12300102 | Credential not
enrolle
d. |
**示例:**
**示例:**
```
js
```
js
...
@@ -5615,6 +5660,7 @@ getAuthInfo(callback: AsyncCallback<Array<EnrolledCredInfo>>): void;
...
@@ -5615,6 +5660,7 @@ getAuthInfo(callback: AsyncCallback<Array<EnrolledCredInfo>>): void;
| 错误码ID | 错误信息 |
| 错误码ID | 错误信息 |
| -------- | --------------------- |
| -------- | --------------------- |
| 12300001 | System service exception. |
| 12300001 | System service exception. |
| 12300102 | Credential not enrolled. |
**示例:**
**示例:**
```
js
```
js
...
@@ -5654,6 +5700,7 @@ getAuthInfo(authType: AuthType, callback: AsyncCallback<Array<EnrolledCred
...
@@ -5654,6 +5700,7 @@ getAuthInfo(authType: AuthType, callback: AsyncCallback<Array<EnrolledCred
| -------- | ------------------- |
| -------- | ------------------- |
| 12300001 | System service exception. |
| 12300001 | System service exception. |
| 12300002 | Invalid authType. |
| 12300002 | Invalid authType. |
| 12300102 | Credential not enrolled. |
**示例:**
**示例:**
```
js
```
js
...
@@ -5698,6 +5745,7 @@ getAuthInfo(authType?: AuthType): Promise<Array<EnrolledCredInfo>>;
...
@@ -5698,6 +5745,7 @@ getAuthInfo(authType?: AuthType): Promise<Array<EnrolledCredInfo>>;
| -------- | ------------------- |
| -------- | ------------------- |
| 12300001 | System service exception. |
| 12300001 | System service exception. |
| 12300002 | Invalid authType. |
| 12300002 | Invalid authType. |
| 12300102 | Credential not enrolled. |
**示例:**
**示例:**
```
js
```
js
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录