Best way to config Global Headers for Get, Post, Patch in VueJS
问题 I'm new with VueJs, I'm finding best way to config Global Headers for Get, Post, Patch in VueJS, which is easy to use and strong security . In the current I just write it in export default {} for every components and it's very bad I know. So I ask you guys to help. Fixed Thanks to @Hardik Satasiya ~/plugins/axios.js Every Components: import axios from 'axios' var api = axios.create({ baseURL: 'http://localhost:8000/api/v1/', headers: {'Authorization': 'JWT ' + store.state.token} }) export