let formData = new FormData();
formData.append('file', fileList[0]);
fetch("接口名称", {
method: 'POST',
headers:{
// 'Content-Type': 'multipart/form-data',//添加之后,后台会报500异常
"userToken":"fasdfasdfasdf",//根据自己的后台是否需要
},
body: formData,//将formData 赋值给body即可
}).then(response => response.json())
.then(json => {
console.log('--176--'+JSON.stringify(json));
}).catch(error => console.log("--179--"+error));