Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
40e2d23e
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看板
提交
40e2d23e
编写于
7月 19, 2023
作者:
W
wangdongqi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Signed-off-by: wangdongqi <wangdongqi2@huawei.com>
Changes to be committed:
上级
17a77a76
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
13 addition
and
75 deletion
+13
-75
zh-cn/application-dev/reference/apis/js-apis-request.md
zh-cn/application-dev/reference/apis/js-apis-request.md
+13
-75
未找到文件。
zh-cn/application-dev/reference/apis/js-apis-request.md
浏览文件 @
40e2d23e
...
@@ -494,11 +494,7 @@ delete(): Promise<boolean>
...
@@ -494,11 +494,7 @@ delete(): Promise<boolean>
```
js
```
js
uploadTask
.
delete
().
then
((
result
)
=>
{
uploadTask
.
delete
().
then
((
result
)
=>
{
if
(
result
)
{
console
.
info
(
'
Succeeded in deleting the upload task.
'
);
console
.
info
(
'
Succeeded in deleting the upload task.
'
);
}
else
{
console
.
error
(
`Failed to delete the upload task. Code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
}
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
error
(
`Failed to delete the upload task. Code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
console
.
error
(
`Failed to delete the upload task. Code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
});
});
...
@@ -529,11 +525,7 @@ delete(callback: AsyncCallback<boolean>): void
...
@@ -529,11 +525,7 @@ delete(callback: AsyncCallback<boolean>): void
console
.
error
(
`Failed to delete the upload task. Code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
console
.
error
(
`Failed to delete the upload task. Code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
return
;
return
;
}
}
if
(
result
)
{
console
.
info
(
'
Succeeded in deleting the upload task.
'
);
console
.
info
(
'
Succeeded in deleting the upload task.
'
);
}
else
{
console
.
error
(
`Failed to delete the upload task. Code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
}
});
});
```
```
...
@@ -560,11 +552,7 @@ remove(): Promise<boolean>
...
@@ -560,11 +552,7 @@ remove(): Promise<boolean>
```
js
```
js
uploadTask
.
remove
().
then
((
result
)
=>
{
uploadTask
.
remove
().
then
((
result
)
=>
{
if
(
result
)
{
console
.
info
(
'
Succeeded in removing the upload task.
'
);
console
.
info
(
'
Succeeded in removing the upload task.
'
);
}
else
{
console
.
error
(
`Failed to remove the upload task. Code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
}
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
error
(
`Failed to remove the upload task. Code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
console
.
error
(
`Failed to remove the upload task. Code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
});
});
...
@@ -1059,11 +1047,7 @@ delete(): Promise<boolean>
...
@@ -1059,11 +1047,7 @@ delete(): Promise<boolean>
```
js
```
js
downloadTask
.
delete
().
then
((
result
)
=>
{
downloadTask
.
delete
().
then
((
result
)
=>
{
if
(
result
)
{
console
.
info
(
'
Succeeded in removing the download task.
'
);
console
.
info
(
'
Succeeded in removing the download task.
'
);
}
else
{
console
.
error
(
`Failed to remove the download task. Code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
}
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
error
(
`Failed to remove the download task. Code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
console
.
error
(
`Failed to remove the download task. Code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
});
});
...
@@ -1094,11 +1078,7 @@ delete(callback: AsyncCallback<boolean>): void
...
@@ -1094,11 +1078,7 @@ delete(callback: AsyncCallback<boolean>): void
console
.
error
(
`Failed to remove the download task. Code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
console
.
error
(
`Failed to remove the download task. Code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
return
;
return
;
}
}
if
(
result
)
{
console
.
info
(
'
Succeeded in removing the download task.
'
);
console
.
info
(
'
Succeeded in removing the download task.
'
);
}
else
{
console
.
error
(
`Failed to remove the download task. Code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
}
});
});
```
```
...
@@ -1235,11 +1215,7 @@ suspend(): Promise<boolean>
...
@@ -1235,11 +1215,7 @@ suspend(): Promise<boolean>
```
js
```
js
downloadTask
.
suspend
().
then
((
result
)
=>
{
downloadTask
.
suspend
().
then
((
result
)
=>
{
if
(
result
)
{
console
.
info
(
'
Succeeded in pausing the download task.
'
);
console
.
info
(
'
Succeeded in pausing the download task.
'
);
}
else
{
console
.
error
(
`Failed to pause the download task. Code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
}
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
error
(
`Failed to pause the download task. Code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
console
.
error
(
`Failed to pause the download task. Code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
});
});
...
@@ -1270,11 +1246,7 @@ suspend(callback: AsyncCallback<boolean>): void
...
@@ -1270,11 +1246,7 @@ suspend(callback: AsyncCallback<boolean>): void
console
.
error
(
`Failed to pause the download task. Code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
console
.
error
(
`Failed to pause the download task. Code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
return
;
return
;
}
}
if
(
result
)
{
console
.
info
(
'
Succeeded in pausing the download task.
'
);
console
.
info
(
'
Succeeded in pausing the download task.
'
);
}
else
{
console
.
error
(
`Failed to pause the download task. Code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
}
});
});
```
```
...
@@ -1299,11 +1271,6 @@ restore(): Promise<boolean>
...
@@ -1299,11 +1271,6 @@ restore(): Promise<boolean>
```
js
```
js
downloadTask
.
restore
().
then
((
result
)
=>
{
downloadTask
.
restore
().
then
((
result
)
=>
{
if
(
result
)
{
console
.
info
(
'
Succeeded in resuming the download task.
'
)
}
else
{
console
.
error
(
`Failed to resume the download task. Code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
}
console
.
info
(
'
Succeeded in resuming the download task.
'
)
console
.
info
(
'
Succeeded in resuming the download task.
'
)
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
error
(
`Failed to resume the download task. Code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
console
.
error
(
`Failed to resume the download task. Code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
...
@@ -1335,11 +1302,7 @@ restore(callback: AsyncCallback<boolean>): void
...
@@ -1335,11 +1302,7 @@ restore(callback: AsyncCallback<boolean>): void
console
.
error
(
`Failed to resume the download task. Code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
console
.
error
(
`Failed to resume the download task. Code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
return
;
return
;
}
}
if
(
result
)
{
console
.
info
(
'
Succeeded in resuming the download task.
'
);
console
.
info
(
'
Succeeded in resuming the download task.
'
);
}
else
{
console
.
error
(
`Failed to resume the download task. Code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
}
});
});
```
```
...
@@ -1366,11 +1329,7 @@ remove(): Promise<boolean>
...
@@ -1366,11 +1329,7 @@ remove(): Promise<boolean>
```
js
```
js
downloadTask
.
remove
().
then
((
result
)
=>
{
downloadTask
.
remove
().
then
((
result
)
=>
{
if
(
result
)
{
console
.
info
(
'
Succeeded in removing the download task.
'
);
console
.
info
(
'
Succeeded in removing the download task.
'
);
}
else
{
console
.
error
(
`Failed to remove the download task. Code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
}
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
error
(
`Failed to remove the download task. Code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
console
.
error
(
`Failed to remove the download task. Code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
});
});
...
@@ -1402,12 +1361,8 @@ remove(callback: AsyncCallback<boolean>): void
...
@@ -1402,12 +1361,8 @@ remove(callback: AsyncCallback<boolean>): void
if
(
err
)
{
if
(
err
)
{
console
.
error
(
`Failed to remove the download task. Code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
console
.
error
(
`Failed to remove the download task. Code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
return
;
return
;
}
}
if
(
result
)
{
console
.
info
(
'
Succeeded in removing the download task.
'
);
console
.
info
(
'
Succeeded in removing the download task.
'
);
}
else
{
console
.
error
(
`Failed to remove the download task. Code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
}
});
});
```
```
...
@@ -1554,11 +1509,7 @@ pause(): Promise<void>
...
@@ -1554,11 +1509,7 @@ pause(): Promise<void>
```
js
```
js
downloadTask
.
pause
().
then
((
result
)
=>
{
downloadTask
.
pause
().
then
((
result
)
=>
{
if
(
result
)
{
console
.
info
(
'
Succeeded in pausing the download task.
'
);
console
.
info
(
'
Succeeded in pausing the download task.
'
);
}
else
{
console
.
error
(
`Failed to pause the download task. Code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
}
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
error
(
`Failed to pause the download task. Code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
console
.
error
(
`Failed to pause the download task. Code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
});
});
...
@@ -1591,11 +1542,7 @@ pause(callback: AsyncCallback<void>): void
...
@@ -1591,11 +1542,7 @@ pause(callback: AsyncCallback<void>): void
console
.
error
(
`Failed to pause the download task. Code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
console
.
error
(
`Failed to pause the download task. Code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
return
;
return
;
}
}
if
(
result
)
{
console
.
info
(
'
Succeeded in pausing the download task.
'
);
console
.
info
(
'
Succeeded in pausing the download task.
'
);
}
else
{
console
.
error
(
`Failed to pause the download task. Code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
}
});
});
```
```
...
@@ -1622,11 +1569,6 @@ resume(): Promise<void>
...
@@ -1622,11 +1569,6 @@ resume(): Promise<void>
```
js
```
js
downloadTask
.
resume
().
then
((
result
)
=>
{
downloadTask
.
resume
().
then
((
result
)
=>
{
if
(
result
)
{
console
.
info
(
'
Succeeded in resuming the download task.
'
)
}
else
{
console
.
error
(
`Failed to resume the download task. Code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
}
console
.
info
(
'
Succeeded in resuming the download task.
'
)
console
.
info
(
'
Succeeded in resuming the download task.
'
)
}).
catch
((
err
)
=>
{
}).
catch
((
err
)
=>
{
console
.
error
(
`Failed to resume the download task. Code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
console
.
error
(
`Failed to resume the download task. Code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
...
@@ -1660,11 +1602,7 @@ resume(callback: AsyncCallback<void>): void
...
@@ -1660,11 +1602,7 @@ resume(callback: AsyncCallback<void>): void
console
.
error
(
`Failed to resume the download task. Code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
console
.
error
(
`Failed to resume the download task. Code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
return
;
return
;
}
}
if
(
result
)
{
console
.
info
(
'
Succeeded in resuming the download task.
'
);
console
.
info
(
'
Succeeded in resuming the download task.
'
);
}
else
{
console
.
error
(
`Failed to resume the download task. Code:
${
err
.
code
}
, message:
${
err
.
message
}
`
);
}
});
});
```
```
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录