import axios from 'axios'

const service = axios.create({
  baseURL: process.env.VUE_APP_HOST_URL + process.env.VUE_APP_BASE_URL,
  timeout: 120000
})

service.interceptors.request.use((request) => {
  return request
})

service.interceptors.response.use((response) => {
  const data = response.data
  if (data && data.status === '200') {
    return data
  } else {
    return Promise.reject(data)
  }
})

export default service
