MCPcopy Create free account
hub / github.com/Xu22Web/tech-study-js / getVideoList

Function getVideoList

tech-study.js:426–441  ·  view source on GitHub ↗

* @description 获取视频数据

()

Source from the content-addressed store, hash-verified

424 * @description 获取视频数据
425 */
426async function getVideoList() {
427 // 随机
428 const randNum = ~~(Math.random() * API_CONFIG.todayVideos.length);
429 try {
430 // 获取重要新闻
431 const res = await fetch(API_CONFIG.todayVideos[randNum], {
432 method: 'GET',
433 });
434 // 请求成功
435 if (res.ok) {
436 const data = await res.json();
437 return data;
438 }
439 }
440 catch (err) { }
441}
442/**
443 * @description 专项练习数据
444 */

Callers 1

getVideosFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected