export function postFormData(url, data) {
return service({
url: url,
method: 'post',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
transformRequest: [
function (data) {
let ret = '';
for (const it in data) {
const value = typeof data[it] === 'object' ? JSON.stringify(data[it]) : data[it];
ret += encodeURIComponent(it) + '=' + encodeURIComponent(value) + '&';
}
return ret;
},
],
data,
});
}