设置axios为form-data
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
}]
写在core.js core文件参考 axios的封装
转载请注明原文地址:https://ipadbbs.8miu.com/read-17036.html