biliob/Web/js/httpUtils.js
2024-10-29 18:29:56 +08:00

19 lines
403 B
JavaScript

/**
*
* @param {*} callback 回调
*/
function getLiveVideoList(callback){
fetch("/live/video/list")
.then(response => {
if (!response.ok) {
throw new Error(`HTTP error! Status: ${response.status}`);
}
return response.json();
})
.then(data => {
callback.success(data);
})
.catch(error => {
callback.error(error);
});
}