You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
758 B
26 lines
758 B
//微信小程序适配器
|
|
module.exports=function(request, responseCallback) {
|
|
let con = {
|
|
method: request.method,
|
|
url: request.url,
|
|
dataType: request.dataType || undefined,
|
|
header: request.headers,
|
|
data: request.body||{},
|
|
responseType: request.responseType || 'text',
|
|
success(res) {
|
|
responseCallback({
|
|
statusCode: res.statusCode,
|
|
responseText: res.data,
|
|
headers: res.header,
|
|
statusMessage: res.errMsg
|
|
})
|
|
},
|
|
fail(res) {
|
|
responseCallback({
|
|
statusCode: res.statusCode||0,
|
|
statusMessage: res.errMsg
|
|
})
|
|
}
|
|
}
|
|
wx.request(con)
|
|
}
|
|
|