1***@qq.com
1***@qq.com
  • 发布:2024-10-16 17:48
  • 更新:2024-10-16 17:48
  • 阅读:39

【报Bug】uni.downloadFile 返回的是400

分类:MUI

产品分类: 其他/MUI

示例代码:

const downloadTask = uni.downloadFile({
url: encodeURI(downMes.path), //仅为示例,并非真实的资源
filename: "_doc/update/",
success: res => {
console.log('88',res,downMes);
if (res.statusCode === 200) {
var path = res.tempFilePath;
waiting.setTitle('安装中...');
plus.runtime.install(path, {}, function() {
plus.nativeUI.closeWaiting();
if (downMes.type == 2) { // 热更新
uniToast('更新成功,重启中');
setTimeout(function() {
plus.runtime.restart();
}, 1500)
}
}, function(e) {
plus.nativeUI.closeWaiting();
plus.nativeUI.alert("安装失败[" + e.code + "]:" + e.message);
});
} else {
uniToast('升级失败,请稍后重试!');
}
}
});

操作步骤:

{ "tempFilePath": "_doc/uniapp_temp_1729071497890/download/", "statusCode": 400, "errMsg": "downloadFile:ok" }

预期结果:

,下载地址都获取到,打印出来是{ "tempFilePath": "_doc/uniapp_temp_1729071497890/download/下载地址", "statusCode": 400, "errMsg": "downloadFile:ok" }

实际结果:

,下载地址都获取到,打印出来是{ "tempFilePath": "_doc/uniapp_temp_1729071497890/download/", "statusCode": 400, "errMsg": "downloadFile:ok" }

bug描述:

下载地址都获取到,打印出来是{ "tempFilePath": "_doc/uniapp_temp_1729071497890/download/", "statusCode": 400, "errMsg": "downloadFile:ok" }

2024-10-16 17:48 负责人:无 分享
已邀请:

要回复问题请先登录注册