接口是否支持跨域测试
Ajax方式
var xhr = new XMLHttpRequest();
xhr.open('GET', 'http://localhost:8888/api/kernels');
xhr.send(null);
xhr.onload = function(e) {
var xhr = e.target;
console.log(xhr.responseText);
}
Fetch方式
fetch(`http://localhost:8888/api/kernels?${new Date().getTime()}`, {method: 'get'}).then(res => console.log(res))