Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
18a6cf7b
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看板
提交
18a6cf7b
编写于
8月 23, 2023
作者:
S
swg3156201044
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
账号文档示例代码ArxTs规范整改
Signed-off-by:
N
swg3156201044
<
shiweigang2@huawei.com
>
上级
d8d387e9
变更
3
展开全部
显示空白变更内容
内联
并排
Showing
3 changed file
with
617 addition
and
330 deletion
+617
-330
zh-cn/application-dev/reference/apis/js-apis-appAccount.md
zh-cn/application-dev/reference/apis/js-apis-appAccount.md
+551
-292
zh-cn/application-dev/reference/apis/js-apis-distributed-account.md
...ication-dev/reference/apis/js-apis-distributed-account.md
+64
-36
zh-cn/application-dev/reference/apis/js-apis-osAccount.md
zh-cn/application-dev/reference/apis/js-apis-osAccount.md
+2
-2
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-appAccount.md
浏览文件 @
18a6cf7b
此差异已折叠。
点击以展开。
zh-cn/application-dev/reference/apis/js-apis-distributed-account.md
浏览文件 @
18a6cf7b
...
...
@@ -59,9 +59,12 @@ getOsAccountDistributedInfo(callback: AsyncCallback<DistributedInfo>): voi
**示例:**
```
js
import
{
BusinessError
}
from
'
@ohos.base
'
;
const
accountAbility
=
account_distributedAccount
.
getDistributedAccountAbility
();
try
{
accountAbility
.
getOsAccountDistributedInfo
((
err
,
data
)
=>
{
accountAbility
.
getOsAccountDistributedInfo
(
(
err
:
BusinessError
,
data
:
account_distributedAccount
.
DistributedInfo
)
=>
{
if
(
err
)
{
console
.
log
(
'
getOsAccountDistributedInfo exception:
'
+
JSON
.
stringify
(
err
));
}
else
{
...
...
@@ -97,11 +100,13 @@ getOsAccountDistributedInfo(): Promise<DistributedInfo>
**示例:**
```
js
import
{
BusinessError
}
from
'
@ohos.base
'
;
const
accountAbility
=
account_distributedAccount
.
getDistributedAccountAbility
();
try
{
accountAbility
.
getOsAccountDistributedInfo
().
then
((
data
)
=>
{
accountAbility
.
getOsAccountDistributedInfo
().
then
((
data
:
account_distributedAccount
.
DistributedInfo
)
=>
{
console
.
log
(
'
distributed information:
'
+
JSON
.
stringify
(
data
));
}).
catch
((
err
)
=>
{
}).
catch
((
err
:
BusinessError
)
=>
{
console
.
log
(
'
getOsAccountDistributedInfo exception:
'
+
JSON
.
stringify
(
err
));
});
}
catch
(
err
)
{
...
...
@@ -137,9 +142,12 @@ getOsAccountDistributedInfoByLocalId(localId: number, callback: AsyncCallback<
**示例:**
```
js
import
{
BusinessError
}
from
'
@ohos.base
'
;
const
accountAbility
=
account_distributedAccount
.
getDistributedAccountAbility
();
try
{
accountAbility
.
getOsAccountDistributedInfoByLocalId
(
100
,
(
err
,
data
)
=>
{
accountAbility
.
getOsAccountDistributedInfoByLocalId
(
100
,
(
err
:
BusinessError
,
data
:
account_distributedAccount
.
DistributedInfo
)
=>
{
if
(
err
)
{
console
.
log
(
'
getOsAccountDistributedInfoByLocalId exception:
'
+
JSON
.
stringify
(
err
));
}
else
{
...
...
@@ -178,11 +186,14 @@ getOsAccountDistributedInfoByLocalId(localId: number): Promise<DistributedInf
**示例:**
```
js
import
{
BusinessError
}
from
'
@ohos.base
'
;
const
accountAbility
=
account_distributedAccount
.
getDistributedAccountAbility
();
try
{
accountAbility
.
getOsAccountDistributedInfoByLocalId
(
100
).
then
((
data
)
=>
{
accountAbility
.
getOsAccountDistributedInfoByLocalId
(
100
).
then
((
data
:
account_distributedAccount
.
DistributedInfo
)
=>
{
console
.
log
(
'
distributed information:
'
+
JSON
.
stringify
(
data
));
}).
catch
((
err
)
=>
{
}).
catch
((
err
:
BusinessError
)
=>
{
console
.
log
(
'
getOsAccountDistributedInfoByLocalId exception:
'
+
JSON
.
stringify
(
err
));
});
}
catch
(
err
)
{
...
...
@@ -211,8 +222,11 @@ queryOsAccountDistributedInfo(callback: AsyncCallback<DistributedInfo>): v
**示例:**
```
js
import
{
BusinessError
}
from
'
@ohos.base
'
;
const
accountAbility
=
account_distributedAccount
.
getDistributedAccountAbility
();
accountAbility
.
queryOsAccountDistributedInfo
((
err
,
data
)
=>
{
accountAbility
.
queryOsAccountDistributedInfo
(
(
err
:
BusinessError
,
data
:
account_distributedAccount
.
DistributedInfo
)
=>
{
if
(
err
)
{
console
.
log
(
'
queryOsAccountDistributedInfo exception:
'
+
JSON
.
stringify
(
err
));
}
else
{
...
...
@@ -243,10 +257,12 @@ queryOsAccountDistributedInfo(): Promise<DistributedInfo>
**示例:**
```
js
import
{
BusinessError
}
from
'
@ohos.base
'
;
const
accountAbility
=
account_distributedAccount
.
getDistributedAccountAbility
();
accountAbility
.
queryOsAccountDistributedInfo
().
then
((
data
)
=>
{
accountAbility
.
queryOsAccountDistributedInfo
().
then
((
data
:
account_distributedAccount
.
DistributedInfo
)
=>
{
console
.
log
(
'
distributed information:
'
+
JSON
.
stringify
(
data
));
}).
catch
((
err
)
=>
{
}).
catch
((
err
:
BusinessError
)
=>
{
console
.
log
(
'
queryOsAccountDistributedInfo exception:
'
+
JSON
.
stringify
(
err
));
});
```
...
...
@@ -278,10 +294,12 @@ setOsAccountDistributedInfo(accountInfo: DistributedInfo, callback: AsyncCallbac
**示例:**
```
js
import
{
BusinessError
}
from
'
@ohos.base
'
;
const
accountAbility
=
account_distributedAccount
.
getDistributedAccountAbility
();
let
accountInfo
=
{
id
:
'
12345
'
,
name
:
'
ZhangSan
'
,
event
:
'
Ohos.account.event.LOGIN
'
};
try
{
accountAbility
.
setOsAccountDistributedInfo
(
accountInfo
,
(
err
)
=>
{
accountAbility
.
setOsAccountDistributedInfo
(
accountInfo
,
(
err
:
BusinessError
)
=>
{
if
(
err
)
{
console
.
log
(
'
setOsAccountDistributedInfo exception:
'
+
JSON
.
stringify
(
err
));
}
else
{
...
...
@@ -325,12 +343,14 @@ setOsAccountDistributedInfo(accountInfo: DistributedInfo): Promise<void>
**示例:**
```
js
import
{
BusinessError
}
from
'
@ohos.base
'
;
const
accountAbility
=
account_distributedAccount
.
getDistributedAccountAbility
();
let
accountInfo
=
{
id
:
'
12345
'
,
name
:
'
ZhangSan
'
,
event
:
'
Ohos.account.event.LOGIN
'
};
try
{
accountAbility
.
setOsAccountDistributedInfo
(
accountInfo
).
then
(()
=>
{
console
.
log
(
'
setOsAccountDistributedInfo successfully
'
);
}).
catch
((
err
)
=>
{
}).
catch
((
err
:
BusinessError
)
=>
{
console
.
log
(
'
setOsAccountDistributedInfo exception:
'
+
JSON
.
stringify
(
err
));
});
}
catch
(
err
)
{
...
...
@@ -368,10 +388,12 @@ setOsAccountDistributedInfoByLocalId(localId: number, distributedInfo: Distribut
**示例:**
```
js
import
{
BusinessError
}
from
'
@ohos.base
'
;
const
accountAbility
=
account_distributedAccount
.
getDistributedAccountAbility
();
let
accountInfo
=
{
id
:
'
12345
'
,
name
:
'
ZhangSan
'
,
event
:
'
Ohos.account.event.LOGIN
'
};
try
{
accountAbility
.
setOsAccountDistributedInfoByLocalId
(
100
,
accountInfo
,
(
err
)
=>
{
accountAbility
.
setOsAccountDistributedInfoByLocalId
(
100
,
accountInfo
,
(
err
:
BusinessError
)
=>
{
if
(
err
)
{
console
.
log
(
'
setOsAccountDistributedInfoByLocalId exception:
'
+
JSON
.
stringify
(
err
));
}
else
{
...
...
@@ -419,12 +441,14 @@ setOsAccountDistributedInfoByLocalId(localId: number, distributedInfo: Distribut
**示例:**
```
js
import
{
BusinessError
}
from
'
@ohos.base
'
;
const
accountAbility
=
account_distributedAccount
.
getDistributedAccountAbility
();
let
accountInfo
=
{
id
:
'
12345
'
,
name
:
'
ZhangSan
'
,
event
:
'
Ohos.account.event.LOGIN
'
};
try
{
accountAbility
.
setOsAccountDistributedInfoByLocalId
(
100
,
accountInfo
).
then
(()
=>
{
console
.
log
(
'
setOsAccountDistributedInfoByLocalId successfully
'
);
}).
catch
((
err
)
=>
{
}).
catch
((
err
:
BusinessError
)
=>
{
console
.
log
(
'
setOsAccountDistributedInfoByLocalId exception:
'
+
JSON
.
stringify
(
err
));
});
}
catch
(
err
)
{
...
...
@@ -455,9 +479,11 @@ updateOsAccountDistributedInfo(accountInfo: DistributedInfo, callback: AsyncCall
**示例:**
```
js
import
{
BusinessError
}
from
'
@ohos.base
'
;
const
accountAbility
=
account_distributedAccount
.
getDistributedAccountAbility
();
let
accountInfo
=
{
id
:
'
12345
'
,
name
:
'
ZhangSan
'
,
event
:
'
Ohos.account.event.LOGIN
'
};
accountAbility
.
updateOsAccountDistributedInfo
(
accountInfo
,
(
err
)
=>
{
accountAbility
.
updateOsAccountDistributedInfo
(
accountInfo
,
(
err
:
BusinessError
)
=>
{
if
(
err
)
{
console
.
log
(
'
queryOsAccountDistributedInfo exception:
'
+
JSON
.
stringify
(
err
));
}
else
{
...
...
@@ -492,11 +518,13 @@ updateOsAccountDistributedInfo(accountInfo: DistributedInfo): Promise<void>
**示例:**
```
js
import
{
BusinessError
}
from
'
@ohos.base
'
;
const
accountAbility
=
account_distributedAccount
.
getDistributedAccountAbility
();
let
accountInfo
=
{
id
:
'
12345
'
,
name
:
'
ZhangSan
'
,
event
:
'
Ohos.account.event.LOGIN
'
};
accountAbility
.
updateOsAccountDistributedInfo
(
accountInfo
).
then
(()
=>
{
console
.
log
(
'
updateOsAccountDistributedInfo successfully
'
);
}).
catch
((
err
)
=>
{
}).
catch
((
err
:
BusinessError
)
=>
{
console
.
log
(
'
updateOsAccountDistributedInfo exception:
'
+
JSON
.
stringify
(
err
));
});
```
...
...
zh-cn/application-dev/reference/apis/js-apis-osAccount.md
浏览文件 @
18a6cf7b
...
...
@@ -4195,7 +4195,7 @@ auth(challenge: Uint8Array, authType: AuthType, authTrustLevel: AuthTrustLevel,
let
authTrustLevel
=
account_osAccount
.
AuthTrustLevel
.
ATL1
;
try
{
userAuth
.
auth
(
challenge
,
authType
,
authTrustLevel
,
{
onResult
:
function
(
result
,
extraInfo
)
{
onResult
:
(
result
,
extraInfo
)
=>
{
console
.
log
(
'
auth result =
'
+
result
);
console
.
log
(
'
auth extraInfo =
'
+
JSON
.
stringify
(
extraInfo
));
}
...
...
@@ -4257,7 +4257,7 @@ authUser(userId: number, challenge: Uint8Array, authType: AuthType, authTrustLev
let
authTrustLevel
=
account_osAccount
.
AuthTrustLevel
.
ATL1
;
try
{
userAuth
.
authUser
(
userID
,
challenge
,
authType
,
authTrustLevel
,
{
onResult
:
function
(
result
,
extraInfo
)
{
onResult
:
(
result
,
extraInfo
)
=>
{
console
.
log
(
'
authUser result =
'
+
result
);
console
.
log
(
'
authUser extraInfo =
'
+
JSON
.
stringify
(
extraInfo
));
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录