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

Function getExamPaper

tech-study.js:445–467  ·  view source on GitHub ↗

* @description 专项练习数据

(pageNo)

Source from the content-addressed store, hash-verified

443 * @description 专项练习数据
444 */
445async function getExamPaper(pageNo) {
446 // 链接
447 const url = `${API_CONFIG.paperList}?pageSize=50&pageNo=${pageNo}`;
448 try {
449 // 获取专项练习
450 const res = await fetch(url, {
451 method: 'GET',
452 credentials: 'include',
453 });
454 // 请求成功
455 if (res.ok) {
456 const data = await res.json();
457 const paperJson = decodeURIComponent(escape(window.atob(data.data_str.replace(/-/g, '+').replace(/_/g, '/'))));
458 // JSON格式化
459 const paper = JSON.parse(paperJson);
460 return paper;
461 }
462 }
463 catch (err) {
464 return [];
465 }
466 return [];
467}
468/**
469 * @description 生成二维码
470 */

Callers 2

initExamFunction · 0.70
findExamPaperFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected