import axios from 'axios'

export default () => {
  return axios.create({
    baseURL: 'http://127.0.0.1:8081'
  })
}

import axios from 'axios'
import store from '@/store/store'

export default () => {
  return axios.create({
    baseURL: 'http://127.0.0.1:8081',
    headers: {
      Authorization: `Bearer ${store.state.token}`
    }
  })
}

Set API send authorization header
Set API send authorization header
