1 import axios from 'axios'
2 import btoa from 'btoa'
5 constructor(baseUrl, token = '') {
10 request(path, body = {}) {
12 url: `${this.baseUrl}${path}`,
15 Accept: 'application/json',
22 config.headers['Authorization'] = `Basic ${btoa(this.token)}`
25 return axios.request(config).then(resp => {
26 if (resp.data.status === 'fail') {
28 } else if (resp.data.status === 'success') {
37 export default Connection