多文件上传post
2020-03-16 本文已影响0人
程序员不务正业
var fileList = this.$refs["itemuploadfile"].uploadFiles;
var formData = new FormData();
for (let index = 0; index < fileList.length; index++) {
var fileObj = fileList[index].raw;
formData.append("files", fileObj);
}
formData.append("identCode", "0");
formData.append("identName", "0");
formData.append("tagCode", "1");
formData.append("tagName", "1");
var self = this;
ident_uploads(formData).then((res) => {
console.log('upload file response', res)
if (res) {
self.$message.success("上传成功");
self.getFileList();
}
})