- 发布:2025-06-11 17:11
- 更新:2025-06-11 20:01
- 阅读:190
HarmonyOS 内核4.14 uni.downloadFile 下载安装包文件执行20多秒后就会返回400错误【报Bug】
产品分类: uniapp/App
PC开发环境操作系统: Windows
PC开发环境操作系统版本号: win10
HBuilderX类型: 正式
HBuilderX版本号: 4.66
手机系统: 全部
手机厂商: 华为
页面类型: vue
vue版本: vue2
打包方式: 云端
项目创建方式: HBuilderX
测试过的手机:
示例代码:
const downloadTask = uni.downloadFile({
url:encodeURI(this.filepath) ,
timeout:10006010,
success: res => {
console.log(res)
}
const downloadTask = uni.downloadFile({
url:encodeURI(this.filepath) ,
timeout:10006010,
success: res => {
console.log(res)
}
操作步骤:
const downloadTask = uni.downloadFile({
url:encodeURI(this.filepath) ,
timeout:10006010,
success: res => {
console.log(res)
}
const downloadTask = uni.downloadFile({
url:encodeURI(this.filepath) ,
timeout:10006010,
success: res => {
console.log(res)
}
预期结果:
下载成功
下载成功
实际结果:
下载50%左右报400错误
下载50%左右报400错误
bug描述:
HarmonyOS2.0.0 内核4.14平板 问题:uni.downloadFile 下载安装包文件(21M)执行20多秒后,还没有全部下载完 就会返回400错误。调试和正式包都是这样。
应该是bug吧?
8***@qq.com (作者)
文件后台没有限制,下载几G的都没事。开始我也以为超时造成的,uni.downloadFile 的timeout 我就设置了很长的时间 再测试 也不行。
2025-06-12 16:27