let form_data = new FormData()
for (const element of files) // files是input的类型为file或者拖拽事件产生的files
form_data.append('photo[]', element)
axios({
url: 'http://hostname/api/test',
method: 'post',
data: form_data
}).then(res => {
console.log(res)
})
网友评论