'Access-Control-Allow-Origin'标头包含多个值'http:// localhost:8080,http:// localhost:8080,http:// localhost:8080'

时间:2018-01-02 11:35:38

标签: javascript jquery json ajax

“Access-Control-Allow-Origin”标头包含多个值“http://localhost:8080http://localhost:8080http://localhost:8080”,但只允许一个。因此,不允许原点“http://localhost:8080”访问。

我的代码是:

 $.ajax({
     url: "http://tilesdev1.intra.schneider.com/api/fa-snihelp-service/entserv",
     type: "GET",
     dataType: 'json',
     headers: {
         'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'
     },
     xhrFields: {
         withCredentials: true
     },
     crossDomain: true,
     success: function (result) {
                debugger;
     },
     error: function (xhr, textStatus, error) {
                console.error(error);
     },
}); 

0 个答案:

没有答案