element ui axios使用formdata提交数据

 axios({
//formdata提交
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
transformRequest: [function (data) { let ret = ''; for (let it in data) { ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'; } return ret; }],
method: 'post',
url: 'handler/test',
data: {
id: myVue.form.id
}
}).then((res) => {
if (res.data.status == 0) {
myVue.$message({ message: res.data.msg });
} else {
myVue.$message.error(res.data.msg);
}
});
上一篇:什么是OPTEE-OS


下一篇:SSIS的DelayValidation属性