let apiUrl = "https://interface.huihenduo.com.cn/hhd-pat/" function api(url, data, method) { return new Promise((resolve, reject) => { wx.request({ url: `${apiUrl}/${url}`, method, data, dataType: 'json', header: { 'content-type': 'application/json' }, success: resolve, fail: reject }) }) } module.exports = { apiUrl, api }