From 3a814b62bb9d643926442b07dc16d28042686229 Mon Sep 17 00:00:00 2001
From: zhenyuWang <13641039885@163.com>
Date: Sat, 7 Dec 2024 19:30:45 +0800
Subject: [PATCH] =?UTF-8?q?fix(downloadFile):=20=E4=BF=AE=E5=A4=8D?=
=?UTF-8?q?=E9=94=99=E8=AF=AF=E6=96=B9=E6=B3=95=E5=90=8D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
pages/API/download-file/download-file.uvue | 58 +++++++++++-----------
1 file changed, 29 insertions(+), 29 deletions(-)
diff --git a/pages/API/download-file/download-file.uvue b/pages/API/download-file/download-file.uvue
index 087a67ae..5d1cbbd6 100644
--- a/pages/API/download-file/download-file.uvue
+++ b/pages/API/download-file/download-file.uvue
@@ -10,11 +10,11 @@
点击按钮下载服务端示例图片(下载网络文件到本地临时目录)
-
-
-
- 下载接口的Content-Disposition中的filename非法值例子
-
+
+
+
+ 下载接口的Content-Disposition中的filename非法值例子
+
@@ -37,7 +37,7 @@
imageSrc: '',
task: null as DownloadTask | null,
//自动化测试例专用
- jest_result: false,
+ jest_result: false,
jest_callback_triggred: false
}
},
@@ -71,29 +71,29 @@
this.task?.onProgressUpdate((update) => {
console.log("progress : ", update.progress);
})
- },
- downloadErrorFilename(){
- uni.downloadFile({
- url:"https://qiniu-web-assets.dcloud.net.cn/uni-app-x/static/file/test9.txt",
- success: (res) => {
- console.log('downloadFile success, res is', res.tempFilePath)
- },
- fail: (err) => {
- console.log('downloadFile fail, err is:', err)
- }
- })
+ },
+ downloadErrorFilename(){
+ uni.downloadFile({
+ url:"https://qiniu-web-assets.dcloud.net.cn/uni-app-x/static/file/test9.txt",
+ success: (res) => {
+ console.log('downloadFile success, res is', res.tempFilePath)
+ },
+ fail: (err) => {
+ console.log('downloadFile fail, err is:', err)
+ }
+ })
},
//自动化测试例专用
jest_downloadFile() {
uni.downloadFile({
url: "https://qiniu-web-assets.dcloud.net.cn/unidoc/zh/uni-app.png",
success: () => {
- this.jest_result = true
- this.jest_callback_triggred = true
+ this.jest_result = true
+ this.jest_callback_triggred = true
},
fail: () => {
this.jest_result = false
- this.jest_callback_triggred = true
+ this.jest_callback_triggred = true
}
});
},
@@ -104,11 +104,11 @@
filePath: `${uni.env.CACHE_PATH}/a/b/`,
success: () => {
this.jest_result = true
- this.jest_callback_triggred = true
+ this.jest_callback_triggred = true
},
fail: () => {
this.jest_result = false
- this.jest_callback_triggred = true
+ this.jest_callback_triggred = true
}
});
},
@@ -123,11 +123,11 @@
firstIpv4: false,
success: () => {
this.jest_cookie_download(true)
- this.jest_callback_triggred = true
+ this.jest_callback_triggred = true
},
fail: () => {
this.jest_result = false;
- this.jest_callback_triggred = true
+ this.jest_callback_triggred = true
},
});
},
@@ -142,7 +142,7 @@
firstIpv4: false,
success: () => {
this.jest_cookie_download(false)
- this.jest_callback_triggred = true
+ this.jest_callback_triggred = true
},
fail: () => {
this.jest_result = false;
@@ -169,7 +169,7 @@
this.jest_callback_triggred = true
},
fail: (err : any) => {
- this.jest_result = false
+ this.jest_result = false
this.jest_callback_triggred = true
}
} as CommonOptions)
@@ -178,12 +178,12 @@
jest_special_characters_download() {
uni.downloadFile({
url: "https://web-ext-storage.dcloud.net.cn/hello-uni-app-x/1789834995055525889-你好%23你好.png",
- success: (res : DownloadFileSuccess) => {
- this.jest_result = true;
+ success: (res : DownloadFileSuccess) => {
+ this.jest_result = true;
this.jest_callback_triggred = true
},
fail: () => {
- this.jest_result = false;
+ this.jest_result = false;
this.jest_callback_triggred = true
}
});
--
GitLab