UNPKG

@hzy1123581324/z-view-ui

Version:

z-view-ui是使用vue3开发的组件,开发中,有部分组件功能未实现,慎用

27 lines (25 loc) 665 B
export function requestForm(url, data,header={},method="POST"){ const formdata = new FormData(); for(let name in data){ formdata.set(name,data[name]); } // application/x-www-form-urlencoded Content-Type console.log(formdata,'&&&&&&&&&') return uni.request({ url, method: method|| "POST", header:Object.assign({ 'Content-Type': 'application/x-www-form-urlencoded', },header), data:formdata, dataType: 'json', }) } /* demo requestForm('/payment/pay/pushPayInfo',{}).then((res)=>{ // console.log(res); // }).catch(err=>{ // console.log(err) // }) // })*/