import axios from "axios";
// import
const request = axios.create({
    baseURL: import.meta.env.DEV ? import.meta.env.VITE_DOMAIN_URL: import.meta.env.VITE_DOMAIN_URL,
    timeout: 1000*60,
    headers:{
        'Access-Control-Allow-Origin':'*'
    }
})

request.interceptors.response.use((config)=>{


    if (config.data.code !== 1) {
        console.log('alarm>>>>>>>error:>>>', config.config.url, config.data.msg)
    }
    return config.data
}, (e)=>{
    console.log('alarm>>>>>>>error:>>>', e)
})

export default request
