使用vue-resource,设置头信息:

Vue.http.interceptors.push((request, next) => {
  request.headers.set('Authorization', token)
  console.log(request.headers)
  next(response => {
    console.log(response.status)
    return response
  })
})
Logo

前往低代码交流专区

更多推荐