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信息

 

posted @ 2018-08-30 17:28  翱翔软件  阅读(157)  评论(0编辑  收藏  举报

欢迎访问翱翔软件