Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
ee25bb22
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看板
提交
ee25bb22
编写于
8月 28, 2023
作者:
A
Annie_wang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update docs
Signed-off-by:
N
Annie_wang
<
annie.wangli@huawei.com
>
上级
5a8c3d76
变更
3
展开全部
隐藏空白更改
内联
并排
Showing
3 changed file
with
1352 addition
and
811 deletion
+1352
-811
en/application-dev/reference/apis/js-apis-appAccount.md
en/application-dev/reference/apis/js-apis-appAccount.md
+629
-358
en/application-dev/reference/apis/js-apis-distributed-account.md
...ication-dev/reference/apis/js-apis-distributed-account.md
+76
-42
en/application-dev/reference/apis/js-apis-osAccount.md
en/application-dev/reference/apis/js-apis-osAccount.md
+647
-411
未找到文件。
en/application-dev/reference/apis/js-apis-appAccount.md
浏览文件 @
ee25bb22
此差异已折叠。
点击以展开。
en/application-dev/reference/apis/js-apis-distributed-account.md
浏览文件 @
ee25bb22
...
...
@@ -59,15 +59,18 @@ Obtains distributed account information. This API uses an asynchronous callback
**Example**
```
js
import
{
BusinessError
}
from
'
@ohos.base
'
;
const
accountAbility
=
account_distributedAccount
.
getDistributedAccountAbility
();
try
{
accountAbility
.
getOsAccountDistributedInfo
((
err
,
data
)
=>
{
if
(
err
)
{
console
.
log
(
'
getOsAccountDistributedInfo exception:
'
+
JSON
.
stringify
(
err
));
}
else
{
console
.
log
(
'
distributed information:
'
+
JSON
.
stringify
(
data
));
}
});
accountAbility
.
getOsAccountDistributedInfo
(
(
err
:
BusinessError
,
data
:
account_distributedAccount
.
DistributedInfo
)
=>
{
if
(
err
)
{
console
.
log
(
'
getOsAccountDistributedInfo exception:
'
+
JSON
.
stringify
(
err
));
}
else
{
console
.
log
(
'
distributed information:
'
+
JSON
.
stringify
(
data
));
}
});
}
catch
(
err
)
{
console
.
log
(
'
getOsAccountDistributedInfo exception:
'
+
JSON
.
stringify
(
err
));
}
...
...
@@ -97,11 +100,13 @@ Obtains distributed account information. This API uses a promise to return the r
**Example**
```
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,15 +142,18 @@ Obtains distributed information about an OS account. This API uses an asynchrono
**Example**
```
js
import
{
BusinessError
}
from
'
@ohos.base
'
;
const
accountAbility
=
account_distributedAccount
.
getDistributedAccountAbility
();
try
{
accountAbility
.
getOsAccountDistributedInfoByLocalId
(
100
,
(
err
,
data
)
=>
{
if
(
err
)
{
console
.
log
(
'
getOsAccountDistributedInfoByLocalId exception:
'
+
JSON
.
stringify
(
err
));
}
else
{
console
.
log
(
'
distributed information:
'
+
JSON
.
stringify
(
data
));
}
});
accountAbility
.
getOsAccountDistributedInfoByLocalId
(
100
,
(
err
:
BusinessError
,
data
:
account_distributedAccount
.
DistributedInfo
)
=>
{
if
(
err
)
{
console
.
log
(
'
getOsAccountDistributedInfoByLocalId exception:
'
+
JSON
.
stringify
(
err
));
}
else
{
console
.
log
(
'
distributed information:
'
+
JSON
.
stringify
(
data
));
}
});
}
catch
(
err
)
{
console
.
log
(
'
getOsAccountDistributedInfoByLocalId exception:
'
+
JSON
.
stringify
(
err
));
}
...
...
@@ -178,15 +186,18 @@ Obtains distributed information about an OS account. This API uses a promise to
**Example**
```
js
import
{
BusinessError
}
from
'
@ohos.base
'
;
const
accountAbility
=
account_distributedAccount
.
getDistributedAccountAbility
();
try
{
accountAbility
.
getOsAccountDistributedInfoByLocalId
(
100
).
then
((
data
)
=>
{
console
.
log
(
'
distributed information:
'
+
JSON
.
stringify
(
data
));
}).
catch
((
err
)
=>
{
console
.
log
(
'
getOsAccountDistributedInfoByLocalId exception:
'
+
JSON
.
stringify
(
err
));
accountAbility
.
getOsAccountDistributedInfoByLocalId
(
100
).
then
((
data
:
account_distributedAccount
.
DistributedInfo
)
=>
{
console
.
log
(
'
distributed information:
'
+
JSON
.
stringify
(
data
));
}).
catch
((
err
:
BusinessError
)
=>
{
console
.
log
(
'
getOsAccountDistributedInfoByLocalId exception:
'
+
JSON
.
stringify
(
err
));
});
}
catch
(
err
)
{
console
.
log
(
'
getOsAccountDistributedInfoByLocalId exception:
'
+
JSON
.
stringify
(
err
));
console
.
log
(
'
getOsAccountDistributedInfoByLocalId exception:
'
+
JSON
.
stringify
(
err
));
}
```
...
...
@@ -211,14 +222,17 @@ Obtains distributed account information. This API uses an asynchronous callback
**Example**
```
js
import
{
BusinessError
}
from
'
@ohos.base
'
;
const
accountAbility
=
account_distributedAccount
.
getDistributedAccountAbility
();
accountAbility
.
queryOsAccountDistributedInfo
((
err
,
data
)
=>
{
if
(
err
)
{
console
.
log
(
'
queryOsAccountDistributedInfo exception:
'
+
JSON
.
stringify
(
err
));
}
else
{
console
.
log
(
'
distributed information:
'
+
JSON
.
stringify
(
data
));
}
});
accountAbility
.
queryOsAccountDistributedInfo
(
(
err
:
BusinessError
,
data
:
account_distributedAccount
.
DistributedInfo
)
=>
{
if
(
err
)
{
console
.
log
(
'
queryOsAccountDistributedInfo exception:
'
+
JSON
.
stringify
(
err
));
}
else
{
console
.
log
(
'
distributed information:
'
+
JSON
.
stringify
(
data
));
}
});
```
### queryOsAccountDistributedInfo<sup>(deprecated)</sup>
...
...
@@ -243,10 +257,12 @@ Obtains distributed account information. This API uses a promise to return the r
**Example**
```
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,13 @@ Sets the distributed account information. This API uses an asynchronous callback
**Example**
```
js
import
{
BusinessError
}
from
'
@ohos.base
'
;
const
accountAbility
=
account_distributedAccount
.
getDistributedAccountAbility
();
let
accountInfo
=
{
id
:
'
12345
'
,
name
:
'
ZhangSan
'
,
event
:
'
Ohos.account.event.LOGIN
'
};
let
accountInfo
:
account_distributedAccount
.
DistributedInfo
=
{
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 +344,15 @@ Sets the distributed account information. This API uses a promise to return the
**Example**
```
js
import
{
BusinessError
}
from
'
@ohos.base
'
;
const
accountAbility
=
account_distributedAccount
.
getDistributedAccountAbility
();
let
accountInfo
=
{
id
:
'
12345
'
,
name
:
'
ZhangSan
'
,
event
:
'
Ohos.account.event.LOGIN
'
};
let
accountInfo
:
account_distributedAccount
.
DistributedInfo
=
{
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 +390,13 @@ Sets the distributed information for an OS account. This API uses an asynchronou
**Example**
```
js
import
{
BusinessError
}
from
'
@ohos.base
'
;
const
accountAbility
=
account_distributedAccount
.
getDistributedAccountAbility
();
let
accountInfo
=
{
id
:
'
12345
'
,
name
:
'
ZhangSan
'
,
event
:
'
Ohos.account.event.LOGIN
'
};
let
accountInfo
:
account_distributedAccount
.
DistributedInfo
=
{
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 +444,15 @@ Sets the distributed information for an OS account. This API uses a promise to r
**Example**
```
js
import
{
BusinessError
}
from
'
@ohos.base
'
;
const
accountAbility
=
account_distributedAccount
.
getDistributedAccountAbility
();
let
accountInfo
=
{
id
:
'
12345
'
,
name
:
'
ZhangSan
'
,
event
:
'
Ohos.account.event.LOGIN
'
};
let
accountInfo
:
account_distributedAccount
.
DistributedInfo
=
{
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 +483,12 @@ Updates the distributed account information. This API uses an asynchronous callb
**Example**
```
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
)
=>
{
let
accountInfo
:
account_distributedAccount
.
DistributedInfo
=
{
id
:
'
12345
'
,
name
:
'
ZhangSan
'
,
event
:
'
Ohos.account.event.LOGIN
'
};
accountAbility
.
updateOsAccountDistributedInfo
(
accountInfo
,
(
err
:
BusinessError
)
=>
{
if
(
err
)
{
console
.
log
(
'
queryOsAccountDistributedInfo exception:
'
+
JSON
.
stringify
(
err
));
}
else
{
...
...
@@ -492,11 +523,14 @@ Updates the distributed account information. This API uses a promise to return t
**Example**
```
js
import
{
BusinessError
}
from
'
@ohos.base
'
;
const
accountAbility
=
account_distributedAccount
.
getDistributedAccountAbility
();
let
accountInfo
=
{
id
:
'
12345
'
,
name
:
'
ZhangSan
'
,
event
:
'
Ohos.account.event.LOGIN
'
};
let
accountInfo
:
account_distributedAccount
.
DistributedInfo
=
{
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
));
});
```
...
...
en/application-dev/reference/apis/js-apis-osAccount.md
浏览文件 @
ee25bb22
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录