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.
29 lines
490 B
29 lines
490 B
const base = 'https://test.1000my.com:8019'
|
|
const request = (url, body) => new Promise((resolve, reject) => {
|
|
wx.request({
|
|
url: base + url,
|
|
data: body,
|
|
method: "POST",
|
|
success: ({
|
|
data: {
|
|
code,
|
|
data,
|
|
msg
|
|
}
|
|
}) => {
|
|
if (code === '200') resolve(data)
|
|
else wx.showToast({
|
|
icon: 'none',
|
|
title: msg,
|
|
})
|
|
},
|
|
fail: reject,
|
|
})
|
|
})
|
|
const axios = {
|
|
get: request,
|
|
post: request
|
|
}
|
|
export {
|
|
axios
|
|
}
|