title: Vue.js - CORS error in local and production
body: <p>I have got a file that's name is request.js, </p>
  
  <pre><code>import axios from 'axios'
  
  const baseURL = 'https://SOME_URL.com/api/'
  
  const config = {
    baseURL,
    timeout: 10000,
    headers: {
      'Access-Control-Allow-Origin': '*',
      'Access-Control-Allow-Headers': '*',
    }
  }
  
  const request = axios.create(config)
  
  export default request
  </code></pre>
  
  <p>and I'm trying to send request in Vuex Actions;</p>
  
  <pre><code>import request from '../request'
  
  const actions = {
    postData(_, payload){
      return request.post('a-request-url', payload)
    }
  }
  </code></pre>
  
  <p>Sending 2 requests and throws a CORS error when I run request. CORS error <code>Access to XMLHttpRequest at 'https://crm.clinic/api/crm/login' from origin 'http://localhost:8080' has been blocked by CORS policy: Request header field access-control-allow-origin is not allowed by Access-Control-Allow-Headers in preflight response</code></p>
  
  <p>AND 2 requests like;
  <a href="https://i.stack.imgur.com/VZJrx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/VZJrx.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/jy5YS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jy5YS.png" alt="enter image description here"></a></p>
  
  <p><a href="https://i.stack.imgur.com/RasdH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RasdH.png" alt="enter image description here"></a></p>
  
  <p>and the real problem, cors error continious when deploy my code as production. Can you help me?</p>