app端使用files上传多张文件时 提示uploadFile:fail undefined is not an object (evaluating 'e.indexOf') 错误
获取图片代码
uni.chooseImage({
sizeType: ["compressed"],
success: res => {
for (let i = 0; i < res.tempFiles.length; i++) {
let obj = new Object();
obj.name = "img";
obj.url = res.tempFiles[i].path;
this.img.push(obj);
console.log(obj);
obj = null;
}
this.img打印数据
上传部分代码
uni.uploadFile({
url: this.baseUrl + "/forum/publish_article",
fileType: "image",
files: this.img,
formData: {
title: this.title,
content: this.text,
forum_id: this.id,
forum_type: this.type
},
Ningest
感谢
2022-06-12 20:57