{code: 400, message: "存在多个采购单号,请检查excel", data: null}
以上为接口返回值
/**
* 上传
* arraybuffer类型可以转为对象
*/
export const upLoadFile = (url, data) => {
return axios.post(process.env.VUE_APP_URL + url, data, {
headers: {
'Authorization': sessionStorage.getItem('authorization'),
'Content-Type': 'multipart/form-data',
},
responseType: 'arraybuffer',
}).then(res=>{
return Promise.resolve(res);
}).catch(err=>{
//解析返回值
let enc = new TextDecoder('utf-8');
let error = JSON.parse(enc.decode(new Uint8Array(err.response.data)));
return Promise.reject(error.message);
});
}