js  ajax请求传token

方法一:

headers: {
Authorization: "BasicAuth " + token
}

方法二:

beforeSend: function (xhr) {
xhr.setRequestHeader('Authorization', 'BasicAuth ' +token);
}
04-26 06:19