const baseUrl = "http://123.60.111.36:8080/bwj/rest/webclientrest";
class HTTP {
    request({
        url,
        data = {},
        method = "POST",
        header = {
            'content-type': 'application/json'
        }
    }) {
        return new Promise((resolve, reject) => {
            this._request(url, resolve, reject, data, method, header);
        })
    }
    _request(url, resolve, reject, data, method, header) {
        wx.showLoading({
            title: '加载中...',
            mask: true
        })
        wx.request({
            url: baseUrl + url,
            data: data,
            method: method,
            header: header,
            success: (res) => {
                resolve(res.data);
                wx.hideLoading()
            },
            fial: (err) => {
                reject(err);
                wx.hideLoading();
            }
        })
    }
}
export {
    HTTP
}