这可能是因为在你自己的代码中没有正确地传递token。确保使用相同的token,并确保在代码中正确包含token。以下是一个使用jQuery的示例代码:
var token = 'your_token_here';
$.ajax({
url: 'https://api.example.com/resource',
type: 'GET',
headers: {
'Authorization': 'Bearer ' + token
},
success: function(response) {
console.log('Success: ', response);
},
error: function(jqXHR, textStatus, errorThrown) {
console.log('Error: ', textStatus, errorThrown);
}
});
在此示例中,我们在请求中设置授权头部,以在API请求中传递token。确保你的代码中也正确包含了类似的授权头部。