deguodaigou/utils/bin.js
2019-12-13 10:29:54 +08:00

31 lines
539 B
JavaScript

//请求接口
let request = function (obj){
let {
url,
method,
header,
dataType,
responseType,
complete
} = obj
return new Promise((res,rej)=>{
Wx.request({
url,
method,
header,
dataType,
responseType,
success(data){
res(data)
},
fail(data){
rej(data)
},
complete
})
})
}
module.exports = {
request
}