title: Access vuex state in separate axios template js file
body: <p>I have a problem. I have a Vuex state. Also I am making axios request. I have created a separate file for template axios request with predefined header. It looks like this:</p>
  
  <pre><code>import axios from 'axios'
  import store from '../store/index'
  
  export default axios.create({
    baseURL: 'https://k-3soft.com/',
    timeout: 1000,
    headers: {
      'X-Requested-With': 'XMLHttpRequest',
      'Accept': 'application/json',
      'Content-Type': 'application/json',
      'Authorization': `Bearer ${store.getters.getToken}`
    }
  })
  </code></pre>
  
  <p>The problem is that in this case store in undefined. So how can I import to this /src/axios/request.js file my vuex store? 
  Also I have tried <code>import { store } from '../store/index'</code>. 
  My store looks like this:</p>
  
  <pre><code>import Vue from 'vue'
  import Vuex from 'vuex'
  import user from './modules/user'
  
  Vue.use(Vuex)
  
  export default new Vuex.Store({
    namespaced: true,
    modules: {
      user
    },
    state: {
      url: 'https://icfprod.k-3soft.com/',
      token: '',
    },
    getters: {
      getToken: state =&gt; state.token
    },
  })
  </code></pre>
  
  <p>Also may by anyone can share to view any repository where there is Vuex with modules, axios with file with separate predefined template. Just wanna see how to organize my project's structure. Thanks everyone for help.</p>