背景:

   后台跨域使用通配符:context.Response.Headers.Add("Access-Control-Allow-Origin", "*");

  前端使用VUE axios 请求:

getData() {
this.$axios.get('http://127.0.0.1:8080/xxx/xxxxx',{
headers: {
"Content-Type":"application/json;charset=utf-8"
}
}).then( (response) => {
if( response.data.code === '0000'){
this.items = response.data.data.xxx;
console.log(this.items)
}
})
}
View Code

  

调试:

相关文章:

  • 2021-09-24
  • 2022-12-23
  • 2021-09-18
  • 2022-12-23
  • 2021-09-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-10-27
  • 2021-07-12
  • 2021-05-18
  • 2022-12-23
  • 2021-10-05
  • 2022-12-23
  • 2021-11-04
相关资源
相似解决方案