| 12345678910111213141516171819202122232425262728 |
- 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,
- };
|