CROS+node-basis+ajax

$.ajax({
url: this.baseUrl + this.restful.showDesigerViewList,
type: "post",
dataType: "json",
// beforeSend : function(request){
// request.setRequestHeader("Authorization", th.getToken("token"));
// },
crossDomain: true,
//contentType:"application/x-www-form-urlencoded",
headers: {
'Authorization':(th.getToken("token")),
"Origin": "*",
//"ACCEPT": "application/json",
//'Content-Type':'application/x-www-form-urlencoded',
},
// xhrFields : {
// withCredentials: true
// },
data: obj,
success: function (data, textStatus, xhr) {

},
error: function (e) {
th.disablePage();
}
});

注意:headers里的“Origin”值,然后在带着自己的header信息
原文地址:https://www.cnblogs.com/wsoft/p/9561514.html