the current situation is that the uploaded image is a queue. If you upload one image at a time, multiple images will be called multiple times
the current situation is that the uploaded image is a queue. If you upload one image at a time, multiple images will be called multiple times
use Promise
to implement
function postImg(file){
return new Promise(res => {
var formdata = new FormData()
formdata.append('img', file)
axios.post(url, formdata)
.then(result => {res(result)})
})//promise
}
var fileArr = []
//file
filePromises = fileArr.map(val => postImg(val))
//promise
Promise.all(filePromises)
.then(val => {
//
})