1、依赖VueResource 确保已安装vue-resource到项目中,找到当前项目,命令行输入:
npm install vue-resource --save
在主方法添加 过滤

Vue.http.interceptors.push(function(request, next) {//拦截器
// 跨域携带cookie
 request.credentials = true;
next()
})

以下是针对每个请求都会携带cookie ,也可以指定接口请求携带cookie
this.$http.get('xxxx',{params: 参数对象,credentials: true})

相关文章:

  • 2021-12-06
  • 2021-12-16
  • 2021-12-06
  • 2021-12-06
  • 2018-11-26
  • 2021-08-01
  • 2021-08-19
  • 2021-12-20
猜你喜欢
  • 2021-10-19
  • 2021-11-14
  • 2021-10-19
  • 2021-11-28
  • 2019-11-08
  • 2021-10-19
  • 2021-04-08
相关资源
相似解决方案