我跟踪了ajax调用,并且我发送了GET请求,其标题是Authorization以用于安全目的。
$.ajax({ //actually approve or reject the promotion
url: "/api/testapi/",
type: "GET",
beforeSend: function (request)
{
request.setRequestHeader("Authorization","123456789");
},
data: JSON.stringify({
promotionId: 1
}),
contentType: "application/json; charset=utf-8",
success: function (data) {
console.log(data)
},
error: function (xhRequest, ErrorText, thrownError) {
console.log('xhRequest: ' + xhRequest + "\n");
console.log('ErrorText: ' + ErrorText + "\n");
console.log('thrownError: ' + thrownError + "\n");
}
});

但是,当我发送呼叫时,开发者工具中的“网络”选项卡可以很容易地看到授权的值
出于安全考虑,我需要隐藏此值。
有什么建议吗?