提交 dff5003d 编写于 作者: L liuxiaohang

fix(h5、app): 1、修复H5、APP端,使用download-file时,timeout错误 2、APP端request统一默认值

上级 0b62d333
......@@ -20,8 +20,9 @@ const publishStateChange = (res) => {
const createDownloadTaskById = function (downloadTaskId, {
url,
header,
timeout = __uniConfig.networkTimeout.downloadFile ? __uniConfig.networkTimeout.downloadFile / 1000 : 120
timeout
} = {}) {
timeout = (timeout || (__uniConfig.networkTimeout && __uniConfig.networkTimeout.request) || 60 * 1000) / 1000
const downloader = plus.downloader.createDownload(url, {
timeout,
filename: TEMP_PATH + '/download/',
......
......@@ -46,7 +46,7 @@ export function createRequestTaskById (requestTaskId, {
responseType,
sslVerify = true,
firstIpv4 = false,
timeout = __uniConfig.networkTimeout.request
timeout = (__uniConfig.networkTimeout && __uniConfig.networkTimeout.request) || 60 * 1000
} = {}) {
const stream = requireNativePlugin('stream')
const headers = {}
......
......@@ -46,7 +46,7 @@ class DownloadTask {
export function downloadFile ({
url,
header,
timeout = (__uniConfig.networkTimeout && __uniConfig.networkTimeout.downloadFile) || 60 * 1000
timeout = (__uniConfig.networkTimeout && __uniConfig.networkTimeout.request) || 60 * 1000
}, callbackId) {
const {
invokeCallbackHandler: invoke
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册