biliob/Web/js/httpUtils.js

19 lines
403 B
JavaScript
Raw Normal View History

2024-10-29 18:29:56 +08:00
/**
*
* @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);
});
}