123456789101112131415161718192021222324252627282930 |
- const baseUrl = 'https://jlxwjr.jljrkg.com';
- const imageUrl = 'https://jlxwjr.jljrkg.com';
- module.exports = {
- imageUrl,
- query({url, data, method = 'GET'}) {
- return new Promise((resolve, reject) => {
- wx.request({
- url: `${baseUrl}/${url}`,
- data: data,
- method: method,
- 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,
- });
- });
- },
- }
|