XMLHttpRequest.withCredentials

https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials

var xhr = new XMLHttpRequest();
xhr.open('GET', 'http://example.com/', true);
xhr.withCredentials = true;
xhr.send(null);


$.ajaxSetup({
    type: "POST",
    data: {},
    dataType: 'json',
    xhrFields: {
       withCredentials: true
    },
    crossDomain: true
});

猜你喜欢

转载自www.cnblogs.com/rgqancy/p/9118224.html