1234567891011121314151617181920 |
- import axios from 'axios'
- const TOKEN_KEY = 'eiruAutomation'
- /**
- *
- */
- const init = () => {
- const token = localStorage.getItem(TOKEN_KEY)
- if (!token) {
- return
- }
- axios.defaults.headers.common['Accept'] = 'application/json'
- axios.defaults.headers.common['Content-Type'] = 'application/json'
- axios.defaults.headers.common['Authorization'] = `JWT ${token}`
- }
- export default init
|