cailijuan

1,

$.ajax({
    url:apiUrl,
    type:"get",
    timeout : 5000, //超时时间设置,单位毫秒
    dataType: "json",
    beforeSend: function(xhr) {
        xhr.setRequestHeader("Authorization", "Bearer "+obj.data);
        xhr.setRequestHeader("Accept", "application/json");
    },
    success:function(obj){
        dealApiInterfaceResult(resourceId, obj);
    }
})

2,

$.ajax({
    url:apiUrl,
    type:"get",
    timeout : 5000, //超时时间设置,单位毫秒
    dataType: "json",
    headers: {
             \'Authorization\':"Bearer "+obj.data,
             \'Accept\':"application/json"
         },
    success:function(obj){
        dealApiInterfaceResult(resourceId, obj);
    }
})

 

分类:

技术点:

相关文章:

  • 2021-11-28
  • 2021-11-28
  • 2022-12-23
  • 2021-10-16
  • 2021-10-05
  • 2021-11-28
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-04-17
  • 2021-07-17
  • 2021-11-28
  • 2021-12-05
  • 2021-11-28
相关资源
相似解决方案