manifest.json是设置:
“networkTimeout” : {
“request” : 500, //uni.request 的超时时间,单位毫秒。
“connectSocket” : 500, //uni.connectSocket 的超时时间,单位毫秒。
“uploadFile” : 500, //uni.uploadFile 的超时时间,单位毫秒。
“downloadFile” : 500 //uni.downloadFile 的超时时间,单位毫秒。
},
url 有问题的时候一直不会触发success /fail
比如url:https://192.168.0.509/mp/update/mp.apk
问答
同样遇到该问题, uni.downloadFile url错误导致无法下载时, 无法捕获到错误, 望优化 🙂
uni.downloadFile({
url: update_apk_url,
success: downloadRes => {
if (downloadRes.statusCode === 200) {
() => {
}, e => {
console.log(e);
};
}
},
fail: err => {
console.error(err);
}
});