Total Complexity | 1 |
Complexity/F | 0 |
Lines of Code | 14 |
Function Count | 0 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | import axios from 'axios' |
||
2 | |||
3 | /** |
||
4 | * Axios config |
||
5 | */ |
||
6 | axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest' |
||
7 | |||
8 | let token = document.head.querySelector('meta[name="csrf-token"]') |
||
9 | |||
10 | if (token) { |
||
11 | axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content |
||
12 | } |
||
13 | |||
14 | export { axios } |
||
15 |