用浏览器测试跨域
1.隨便打開一個網頁打開瀏覽器開發者模式console
粘入
var token= "AD3BA267AD984966B3D2179C18FF44F0"; var xhr = new XMLHttpRequest(); xhr.open('GET', 'http://127.0.0.1:8080/test'); xhr.setRequestHeader("x-access-token",token); xhr.send(null); xhr.onload = function(e) {var xhr = e.target;console.log(xhr.responseText); }回車? 有數據則說明跨域成功,沒有token驗證的可以去掉token
總結
- 上一篇: 如何通过官网下载JDK 每一步详细附图
- 下一篇: nacos忘记密码