| 1234567891011121314151617181920212223242526 |
- let v = wx.getAccountInfoSync()
- let {
- envVersion
- } = v.miniProgram
- let apiUrl = `${envVersion == 'release'?'https://interface.huihenduo.cc/hhd-ship/':'https://interface.huihenduo.com.cn/hhd-ship-dev/'}`
- 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
- }
|