任何提示?这是我的代码:
var url = window.CANILE_BASE_URL + 'v2/canile/?location_lat=' + lat + '&location_lng=' + lng;
$.ajax({
type: 'GET',
dataType: 'json',
url: url,
beforeSend: function (xhr) {
alert(1);
var accessToken = localStorage.getItem('accessToken');
xhr.setRequestHeader('Authorization', 'Bearer ' + accessToken);
}
}).success(function (res) {
console.log(res);
}).fail(function (res) {
console.log(res);
});
这是萤火虫的反应: