Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
aee9eccb
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看板
未验证
提交
aee9eccb
编写于
7月 17, 2023
作者:
O
openharmony_ci
提交者:
Gitee
7月 17, 2023
浏览文件
操作
浏览文件
下载
差异文件
!20468 修复示例代码问题
Merge pull request !20468 from cheny/modify_demo_code
上级
e5a7f07f
abe4c0d4
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
19 addition
and
15 deletion
+19
-15
zh-cn/application-dev/reference/apis/js-apis-file-cloudsync.md
.../application-dev/reference/apis/js-apis-file-cloudsync.md
+17
-13
zh-cn/application-dev/reference/apis/js-apis-file-cloudsyncmanager.md
...ation-dev/reference/apis/js-apis-file-cloudsyncmanager.md
+2
-2
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-file-cloudsync.md
浏览文件 @
aee9eccb
...
...
@@ -116,8 +116,8 @@ on(evt: 'progress', callback: (pg: SyncProgress) => void): void
```
js
let
gallerySync
=
new
cloudSync
.
GallerySync
();
gallerySync
.
on
(
'
progress
'
,
(
pg
:
SyncProgress
)
=>
{
console
.
info
(
"
syncState:
"
+
pg
.
s
yncS
tate
);
gallerySync
.
on
(
'
progress
'
,
(
pg
:
cloudSync
.
SyncProgress
)
=>
{
console
.
info
(
"
syncState:
"
+
pg
.
state
);
});
```
...
...
@@ -153,8 +153,8 @@ off(evt: 'progress'): void
```
js
let
gallerySync
=
new
cloudSync
.
GallerySync
();
gallerySync
.
on
(
'
progress
'
,
(
pg
:
SyncProgress
)
=>
{
console
.
info
(
"
syncState:
"
+
pg
.
s
yncS
tate
);
gallerySync
.
on
(
'
progress
'
,
(
pg
:
cloudSync
.
SyncProgress
)
=>
{
console
.
info
(
"
syncState:
"
+
pg
.
state
);
});
gallerySync
.
off
(
'
progress
'
);
...
...
@@ -194,8 +194,8 @@ start(): Promise<void>
```
js
let
gallerySync
=
new
cloudSync
.
GallerySync
();
gallerySync
.
on
(
'
progress
'
,
(
pg
:
SyncProgress
)
=>
{
console
.
info
(
"
syncState:
"
+
pg
.
s
yncS
tate
);
gallerySync
.
on
(
'
progress
'
,
(
pg
:
cloudSync
.
SyncProgress
)
=>
{
console
.
info
(
"
syncState:
"
+
pg
.
state
);
});
gallerySync
.
start
().
then
(
function
()
{
...
...
@@ -411,7 +411,7 @@ on(evt: 'progress', callback: (pg: DownloadProgress) => void): void
```
js
let
download
=
new
cloudSync
.
Download
();
download
.
on
(
'
progress
'
,
(
pg
:
DownloadProgress
)
=>
{
download
.
on
(
'
progress
'
,
(
pg
:
cloudSync
.
DownloadProgress
)
=>
{
console
.
info
(
"
download state:
"
+
pg
.
state
);
});
```
...
...
@@ -448,7 +448,7 @@ off(evt: 'progress'): void
```
js
let
download
=
new
cloudSync
.
Download
();
download
.
on
(
'
progress
'
,
(
pg
:
DownloadProgress
)
=>
{
download
.
on
(
'
progress
'
,
(
pg
:
cloudSync
.
DownloadProgress
)
=>
{
console
.
info
(
"
download state:
"
+
pg
.
state
);
});
...
...
@@ -481,12 +481,13 @@ start(uri: string): Promise<void>
```
js
let
download
=
new
cloudSync
.
Download
();
let
uri
:
string
=
"
file:///media/Photo/1
"
;
download
.
on
(
'
progress
'
,
(
pg
:
DownloadProgress
)
=>
{
download
.
on
(
'
progress
'
,
(
pg
:
cloudSync
.
DownloadProgress
)
=>
{
console
.
info
(
"
download state:
"
+
pg
.
state
);
});
download
.
start
().
then
(
function
()
{
download
.
start
(
uri
).
then
(
function
()
{
console
.
info
(
"
start download successfully
"
);
}).
catch
(
function
(
err
)
{
console
.
info
(
"
start download failed with error message:
"
+
err
.
message
+
"
, error code:
"
+
err
.
code
);
...
...
@@ -538,8 +539,9 @@ start(uri: string, callback: AsyncCallback<void>): void
```
js
let
download
=
new
cloudSync
.
Download
();
let
uri
:
string
=
"
file:///media/Photo/1
"
;
download
.
start
((
err
)
=>
{
download
.
start
(
uri
,
(
err
)
=>
{
if
(
err
)
{
console
.
info
(
"
start download failed with error message:
"
+
err
.
message
+
"
, error code:
"
+
err
.
code
);
}
else
{
...
...
@@ -588,8 +590,9 @@ stop(uri: string): Promise<void>
```
js
let
download
=
new
cloudSync
.
Download
();
let
uri
:
string
=
"
file:///media/Photo/1
"
;
download
.
stop
().
then
(
function
()
{
download
.
stop
(
uri
).
then
(
function
()
{
console
.
info
(
"
stop download successfully
"
);
}).
catch
(
function
(
err
)
{
console
.
info
(
"
stop download failed with error message:
"
+
err
.
message
+
"
, error code:
"
+
err
.
code
);
...
...
@@ -631,8 +634,9 @@ stop(uri: string, callback: AsyncCallback<void>): void
```
js
let
download
=
new
cloudSync
.
Download
();
let
uri
:
string
=
"
file:///media/Photo/1
"
;
download
.
stop
((
err
)
=>
{
download
.
stop
(
uri
,
(
err
)
=>
{
if
(
err
)
{
console
.
info
(
"
stop download failed with error message:
"
+
err
.
message
+
"
, error code:
"
+
err
.
code
);
}
else
{
...
...
zh-cn/application-dev/reference/apis/js-apis-file-cloudsyncmanager.md
浏览文件 @
aee9eccb
...
...
@@ -414,7 +414,7 @@ clean(accountId: string, appActions: { [bundleName: string]: Action }): Promise&
clean(accountId: string, appActions: { [bundleName: string]: Action }, callback: AsyncCallback
<
void
>
): void
异步方法
去使能端云协同能力
,以callback形式返回结果。
异步方法
清理本地云相关数据
,以callback形式返回结果。
**需要权限**
:ohos.permission.CLOUDFILE_SYNC_MANAGER
...
...
@@ -426,7 +426,7 @@ clean(accountId: string, appActions: { [bundleName: string]: Action }, callback:
| ---------- | ------ | ---- | ---- |
| accountId | string | 是 | 帐号Id|
| appActions | object | 是 | 清理动作类型,bundleName为待清理应用包名,
[
Action
](
#action
)
为清理动作类型|
| callback | AsyncCallback
<
void
>
| 是 | 异步
去使能端云协同能力之后的回调
|
| callback | AsyncCallback
<
void
>
| 是 | 异步
方法清理本地云相关数据
|
**错误码:**
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录