java项目跨域问题-前端调试通过F12

 

 

 

 var token="eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhdWQiOiJhZG1pbiIsImlzcyI6IjEifQ.Vrr3ZSo3KVcjPFoMABbN6ir_ApGD47HsPDdoeo5gG84";
var xhr=new XMLHttpRequest();
xhr.open('GET','http://82.157.118.127:8080/v1/users/alldata?currentSize=1&pageSize=1');
xhr.setRequestHeader("token",token);
xhr.send(null);
xhr.onload = function(e) {
    var xhr = e.target;
    console.log(xhr.responseText);
}

 

2)阿里巴巴插件获取跨域问题

posted @ 2021-11-15 17:56  Wind_LPH  阅读(217)  评论(0编辑  收藏  举报