| | |
| | | * @param {String} url |
| | | * @param {*} [data] |
| | | * @param {object} [options] |
| | | * @return {Promise<any>|} |
| | | * @return {Promise<any>} |
| | | */ |
| | | query(type, url, data = null, options = {}) { |
| | | return new Promise((resolve, reject) => { |
| | |
| | | options && options.onCapture && options.onCapture({ |
| | | url: this._createUrlPrefix(options) + url, |
| | | request: data, |
| | | response: response.data, |
| | | response: { ...response.data }, |
| | | httpCode: response.statusCode, |
| | | }); |
| | | /** |
| | |
| | | title: msg, |
| | | icon: 'none', |
| | | mask: false, |
| | | duration: type === 'fail' ? 3000 : 2000, |
| | | duration: (type === 'fail' || type === 'error') ? 3000 : 2000, |
| | | }); |
| | | } |
| | | |