upload(item) {
let data= new FormData();
data.append('file', item.file);
data.append("editId", this.userInfo.userId);
data.append("orgId", this.userInfo.organ.orgId);
data.append("editor", this.userInfo.userName);
// const data = {
// file: file,
// editId: this.userInfo.userId,
// orgId: this.userInfo.organ.orgId,
// editor: this.userInfo.userName
// }
const params = {
orgId: this.userInfo.organ.orgId,
data: data,
};
//调用上传接口
uploadImage(formData)
.then(res => {
});
})
.catch(err => {
this.$message.error('上传失败,请重新上传');
});
},
--------------------------------------------------------------
更具体使用详见formData文件上传