You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
569 B
24 lines
569 B
import axios from 'axios';
|
|
|
|
export default class {
|
|
|
|
constructor({url, params}) {
|
|
this.url = url;
|
|
this.params = params;
|
|
this.isLoadRequest = false;
|
|
this.responseChart = null;
|
|
}
|
|
|
|
async request() {
|
|
if (!this.isLoadRequest) {
|
|
let response = await axios.get(this.url, {params: this.params});
|
|
if (response && response.status === 200) {
|
|
this.responseChart = response.data;
|
|
this.isLoadRequest = true;
|
|
}
|
|
}
|
|
return this.responseChart;
|
|
}
|
|
|
|
}
|