1. 转换成二进制
const requestMethod = (file) => { let reader = new FileReader(); reader.readAsArrayBuffer(file.raw); reader.onload = function (event) { console.log(event.target.result); let res = event.target.result; state.curFile = res; };; };
2. formData
const requestMethod = (file) => { let formData = new FormData(); formData.append('file', file.raw) };