1***@qq.com
1***@qq.com
  • 发布:2021-09-09 14:24
  • 更新:2021-09-09 14:24
  • 阅读:458

upload 自动追加生成参数file??

分类:uni-app
let files = this.$refs.uUpload.lists;  
let formData = {}  
let newFiles = []  
formData.companyInfoSubmitRequestJson =  JSON.stringify(this.form)  
files.forEach((item,index)=>{  
    newFiles.push(item.file)  
})  
formData.files = newFiles  
this.$http.upload(updateCompanyInfo, {formData:formData}).then((res)=>{  
    // if (res.status == '00000') {  
    //  this.$refs.uToast.show({title: '操作成功', back:'/pages/workspace/enterpriseManage'});  
    // }  
}).catch((err)=>{  
    this.$mHelper.toast(err.msg);  
})

检查里面显示

Form Data  
companyInfoSubmitRequestJson: {"id":32,"createUserId":"15","createUserName":"","createTime":1631158637000,"updateUserId":"15","updateUserName":"","updateTime":1631167692000,"companyName":"12","companyNature":1,"companySize":1,"product":null,"companyValue":null,"companyAdvantage":null,"companyDisadvantage":null,"companyNatureId":"国有企业","companySizeId":"1-50人"}  
files:   
file: (binary)

大佬,,用这种方法怎么传多张图片。麻烦大佬们了。。

2021-09-09 14:24 负责人:无 分享
已邀请:

该问题目前已经被锁定, 无法添加新回复