function fn(id) {
$.ajax({
url: 'http://*******/api/xxx',
data: {
id: id,
xx: xx
},
beforeSend: function(request) {
request.setRequestHeader("Authorization", token);
},
dataType: 'JSON',
async: false,//请求是否异步,默认为异步
type: 'GET',
success: function (list) {
},
error: function () {
}
});
}
ajax传输header中加token
最新推荐文章于 2024-07-17 13:49:12 发布