(url, type, param)
| 34 | } |
| 35 | |
| 36 | _request(url, type, param) { |
| 37 | this.view && this.view.$Loading.start(); |
| 38 | |
| 39 | this.config.method = type; |
| 40 | |
| 41 | let request; |
| 42 | if (type === 'get') { |
| 43 | request = axios.get(url, this.config); |
| 44 | } else { |
| 45 | request = axios[type](url, param, this.config); |
| 46 | } |
| 47 | |
| 48 | request.then((response) => { |
| 49 | this.view && this.view.$Loading.finish(); |
| 50 | }).catch((error) => { |
| 51 | this.view && this.view.$Loading.error(); |
| 52 | }); |
| 53 | return request; |
| 54 | } |
| 55 | |
| 56 | } |
| 57 |
no test coverage detected