通过axios请求拦截器添加token
通过axios请求拦截器添加token
通过axios请求拦截器添加token,保证拥有获取数据的权限
axios.interceptors.request.use(config=>{
console.log(config)
config.headers.Authorization = window.sessionStorage.getItem('token')
// 在最后必须返回config
return config
})
通过axios请求拦截器添加token,保证拥有获取数据的权限
axios.interceptors.request.use(config=>{
console.log(config)
config.headers.Authorization = window.sessionStorage.getItem('token')
// 在最后必须返回config
return config
})