function http({url,callback,type="get"}){ $.ajax({ url, type, dataType:"json", success:res=>{ callback(res) }, error:err=>{ console.log(err) }, beforeSend(){ } }) }