function request(url, method = `GET`, data = {}) { return new Promise((resolve, reject) => { wx.request({ url, method, data, success: res => { if (res.statusCode === 200) { resolve(res) } }, fail: err => { reject(err) } }) }) } export function index(params) { return request(`http`,'GET',params) }