1 $.ajax({ 2 type: "GET", 3 url: "test.php", 4 success: function(data) { 5 console.log(data); 6 }, 7 beforeSend: function(xhr) { 8 token = window.localStorage.getItem('token'); 9 xhr.setRequestHeader("Authorization", "Bearer" + token); 10 } 11 });
1 $.ajax({ 2 type: "GET", 3 url: "test.php", 4 success: function(data) { 5 console.log(data); 6 }, 7 beforeSend: function(xhr) { 8 token = window.localStorage.getItem('token'); 9 xhr.setRequestHeader("Authorization", "Bearer" + token); 10 } 11 });
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。