12345678910111213141516171819202122232425262728293031 |
- // const imageUrl = 'https://jlxwjr.jljrkg.com';
- // const baseUrl = 'https://ccss.windd.cn';
- module.exports = {
- imageUrl,
- query({url, data, method = 'GET'}) {
- return new Promise((resolve, reject) => {
- wx.request({
- url: `${baseUrl}/${url}`,
- data: data,
- method: method,
- timeout: 5000,
- header: {'content-type': 'application/json'},
- dataType: 'json',
- success: resolve,
- fail: reject,
- });
- });
- },
- fetch({url, id}) {
- return new Promise((resolve, reject) => {
- wx.request({
- url: `${baseUrl}/${url}/${id}`,
- method: 'GET',
- header: {'content-type': 'application/json'},
- dataType: 'json',
- success: resolve,
- fail: reject,
- });
- });
- },
- }
|