module.exports = (params)=>{ let url = params.url; let method = params.method; let header = params.header || {}; let data = params.data || {}; console.log(data) if(method){ method = method.toUpperCase(); If (method == 'POST'){header = {"content-type":"application/json"}}} if(! Params. HideLoading) {uni. ShowLoading ({title: 'in the load'})} uni. Request ({url: url, method: method | | 'GET', the header: the header, data:data||{}, dataType:'json', sslVerift:false, success:res=>{ if(res.code&&res.code! =200){ return; } return typeof params.success =='function' && params.success(res.data) }, fail:err=>{ return typeof params.fail =='function' && params.fail(err.data) }, Complete :(e)=>{console.log(' request completed ') uni.hideloading () return typeof params.complete =='function' && Import HTTP from './util/http.js' vue.prototype. HTTP = HTTPCopy the code