第一种,全局设置:

Vue.http.headers.common['token'] = 'YXBpOnBhc3N3b3Jk';

第二种,拦截器设置

Vue.http.interceptors.push((request, next) => {
        request.headers.set('token', token); //setting request.headers
        next((response) => {
            return response
     })
})

 

相关文章:

  • 2021-11-28
  • 2021-11-28
  • 2021-11-28
  • 2021-10-12
  • 2021-08-09
  • 2020-07-16
  • 2021-11-02
猜你喜欢
  • 2021-09-12
  • 2022-01-19
  • 2021-06-13
  • 2021-12-13
  • 2021-07-18
  • 2021-10-14
  • 2021-08-31
相关资源
相似解决方案