api.js 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872
  1. import Http from "../utils/http";
  2. class Api {
  3. //合并请求
  4. static async promiseAllSettled(array) {
  5. let res = await Promise.allSettled(array)
  6. res = res.map(item => {
  7. return item.status == "fulfilled" ? item.value : null;
  8. })
  9. return res;
  10. }
  11. static async promiseAll(array) {
  12. let res = await Promise.all(array)
  13. return res;
  14. }
  15. //登录
  16. static login(phone, verify, isLoading) {
  17. return Http.request({
  18. url: `/auth/app/phoneLogin?phone=${phone}&verify=${verify}`,
  19. method: 'POST',
  20. opt: {isLoading}
  21. })
  22. }
  23. //微信登录
  24. static async loginByWX(code, isLoading) {
  25. return Http.request({
  26. url: `/auth/app/wxLogin?code=${code}`,
  27. method: 'POST',
  28. opt: {isLoading}
  29. })
  30. }
  31. //绑定手机号+微信
  32. static binding(code) {
  33. return Http.request({
  34. url: `/auth/app/binding?code=${code}`,
  35. method: 'POST',
  36. })
  37. }
  38. //登出
  39. static appLogout() {
  40. return Http.request({
  41. url: '/auth/app/logout',
  42. method: 'DELETE',
  43. })
  44. }
  45. //发送短信验证码
  46. static sendCode(phone, isLoading) {
  47. return Http.request({
  48. url: `/auth/app/sendVerify?phone=${phone}`,
  49. method: 'POST',
  50. opt: {isLoading}
  51. })
  52. }
  53. //上传文件获取的密钥
  54. static getCosInfo() {
  55. return Http.request({
  56. url: '/video/upload/getCosInfo',
  57. method: 'GET',
  58. })
  59. }
  60. //获取实时音视频的签名
  61. static getSig(data) {
  62. return Http.request({
  63. url: '/video/app/sign/genUserSig',
  64. method: 'GET',
  65. data
  66. })
  67. }
  68. // 注册
  69. static register(data, isLoading) {
  70. return Http.request({
  71. url: `/auth/app/register`,
  72. method: 'POST',
  73. data,
  74. opt: {isLoading}
  75. })
  76. }
  77. //首页
  78. static getIndex(isLoading) {
  79. return Http.request({
  80. url: '/education/app/home/homeIndex/carouselList',
  81. method: 'GET',
  82. opt: {isLoading}
  83. })
  84. }
  85. //获取学员通告列表 0未读 1已读
  86. static getStudentNoticeList(data) {
  87. return Http.request({
  88. url: '/education/app/studentNotice/list',
  89. method: 'GET',
  90. data
  91. })
  92. }
  93. //确认通知为已读
  94. static changeNoticeStatus(data, isLoading) {
  95. return Http.request({
  96. url: '/education/app/studentNotice/changeStatus',
  97. method: 'GET',
  98. data,
  99. opt: {isLoading}
  100. })
  101. }
  102. //获取班级 分类
  103. static getClassList(data) {
  104. return Http.request({
  105. url: '/education/app/home/homeIndex/teamList',
  106. method: 'GET',
  107. data
  108. })
  109. }
  110. //获取往期培训
  111. static getMyHistoryClass(pathV, data) {
  112. return Http.request({
  113. url: `/education/app/team/teamSate/${pathV}`,
  114. method: 'GET',
  115. data
  116. })
  117. }
  118. //获取精品课程 分类
  119. static getCourseMngDict(isLoading) {
  120. return Http.request({
  121. url: '/education/app/home/homeIndex/getDictChild',
  122. method: 'GET',
  123. opt: {isLoading}
  124. })
  125. }
  126. //获取精品课程 列表
  127. static getCourseMngList(data) {
  128. return Http.request({
  129. url: '/education/app/home/homeIndex/courseMngList',
  130. method: 'GET',
  131. data
  132. })
  133. }
  134. //获取教材阅读 分类
  135. static getTextBookDict(isLoading) {
  136. return Http.request({
  137. url: '/resource/app/home/textbookLibrary/selectClassifyList',
  138. method: 'POST',
  139. opt: {isLoading}
  140. })
  141. }
  142. //获取教材阅读 列表
  143. static getTextBookList(id, data) {
  144. return Http.request({
  145. url: `/resource/app/home/textbookLibrary/selectTextbookLibraryClassifyList?textbookClassify=${id}`,
  146. method: 'POST',
  147. data
  148. })
  149. }
  150. //获取教材详细信息
  151. static getBookDetail(pathV, isLoading) {
  152. return Http.request({
  153. url: `/resource/app/home/textbookLibrary/${pathV}`,
  154. method: 'GET',
  155. opt: {isLoading}
  156. })
  157. }
  158. //获取学院简介
  159. static getCollegeList(isLoading) {
  160. return Http.request({
  161. url: '/education/app/home/homeIndex/collegeList',
  162. method: 'GET',
  163. opt: {isLoading}
  164. })
  165. }
  166. //获取指定分类下的新闻列表
  167. static getNewsList(data) {
  168. return Http.request({
  169. url: '/education/app/home/homeIndex/articleList',
  170. method: 'GET',
  171. data
  172. })
  173. }
  174. //获取视频详细信息
  175. static getVideoDetail(pathV, isLoading) {
  176. return Http.request({
  177. url: `/education/app/home/homeIndex/${pathV}`,
  178. method: 'GET',
  179. opt: {isLoading}
  180. })
  181. }
  182. //获取当前用户 正在直播的课
  183. static getUserLiveId(isLoading) {
  184. return Http.request({
  185. url: '/education/app/schedulePerformance/selectSchedulePerformanceMessage',
  186. method: 'GET',
  187. opt: {isLoading}
  188. })
  189. }
  190. //获取当前正在进行的培训
  191. static getUserProjects() {
  192. return Http.request({
  193. url: '/education/app/team/selectRunningByUser',
  194. method: 'GET',
  195. })
  196. }
  197. //获取培训详情
  198. static getProjectsWithTeam(pathV) {
  199. return Http.request({
  200. url: `/education/app/team/userTeamInfo/${pathV}`,
  201. method: 'GET',
  202. })
  203. }
  204. // 提交学员登记表
  205. static submitStudentForm(data) {
  206. return Http.request({
  207. url: '/education/app/student/checkIn',
  208. method: 'POST',
  209. data
  210. })
  211. }
  212. //学员报到
  213. static report(data) {
  214. return Http.request({
  215. url: '/education/app/student/report',
  216. method: 'GET',
  217. data
  218. })
  219. }
  220. //获取上传文件目录
  221. static getUploadFile(data) {
  222. return Http.request({
  223. url: '/education/app/studentUploadFile/getChildren',
  224. method: 'GET',
  225. data,
  226. })
  227. }
  228. //删除文件
  229. static deleteFile(pathV) {
  230. return Http.request({
  231. url: `/education/app/studentUploadFile/${pathV}`,
  232. method: 'DELETE',
  233. })
  234. }
  235. //上传文件
  236. static uploadFile(data) {
  237. return Http.request({
  238. url: '/education/app/studentUploadFile/addFile',
  239. method: 'POST',
  240. data
  241. })
  242. }
  243. //获取班级群
  244. static getTeam(pathV) {
  245. return Http.request({
  246. url: `/education/app/team/infos/${pathV}`,
  247. method: 'GET',
  248. })
  249. }
  250. // 判断是否可以参与期末考试
  251. static checkFinalExam(data) {
  252. return Http.request({
  253. url: '/education/app/courseSchedule/isAllFinish',
  254. method: 'GET',
  255. data
  256. })
  257. }
  258. //获取结业证样式
  259. static getTemplate(data) {
  260. return Http.request({
  261. url: '/education/app/template/getInfo',
  262. method: 'GET',
  263. data
  264. })
  265. }
  266. //获取结业证编号
  267. static getStudentNum(pathV) {
  268. return Http.request({
  269. url: `/education/app/student/${pathV}`,
  270. method: 'GET'
  271. })
  272. }
  273. //生成结业证编号
  274. static produceGradu(id, teamId, isOnline, isLoading) {
  275. return Http.request({
  276. url: `/education/app/student/produceGradu?id=${id}&teamId=${teamId}&isOnline=${isOnline}`,
  277. method: 'POST',
  278. opt: {isLoading}
  279. })
  280. }
  281. //获取班级学员列表
  282. static getStudentList(data) {
  283. return Http.request({
  284. url: '/education/app/student/list',
  285. method: 'GET',
  286. data
  287. })
  288. }
  289. // 住宿安排
  290. static hotelArrange(data) {
  291. return Http.request({
  292. url: '/education/app/hotelArrange/queryArrangeRoom',
  293. method: 'GET',
  294. data
  295. })
  296. }
  297. //获取班级动态
  298. static getTeamInteraction(data) {
  299. return Http.request({
  300. url: '/community/app/teamInteraction/list',
  301. method: 'GET',
  302. data
  303. })
  304. }
  305. //发布班级动态
  306. static publishTeamInteraction(data, isLoading) {
  307. return Http.request({
  308. url: '/community/app/teamInteraction/add',
  309. method: 'POST',
  310. data,
  311. opt: {isLoading}
  312. })
  313. }
  314. // 获取此条动态的评论列表
  315. static getinteractionCommentList(data) {
  316. return Http.request({
  317. url: '/community/app/interactionComment/list',
  318. method: 'GET',
  319. data
  320. })
  321. }
  322. // 发表评论
  323. static addInteractionComment(data, isLoading) {
  324. return Http.request({
  325. url: '/community/app/interactionComment/add',
  326. method: 'POST',
  327. data,
  328. opy: {isLoading}
  329. })
  330. }
  331. //获取课程计划
  332. static getCourseSchedule(data, isLoading) {
  333. return Http.request({
  334. url: '/education/app/courseSchedule/list',
  335. method: 'GET',
  336. data,
  337. opt: {isLoading}
  338. })
  339. }
  340. //获取课程详情
  341. static getCourseDetail(pathV, eId) {
  342. return Http.request({
  343. url: `/education/app/courseSchedule/${pathV}/${eId}`,
  344. method: 'GET',
  345. })
  346. }
  347. //游客获取课程详情 TODO 不需要了。。。看看直播页面需不需要标题
  348. static getGuestCourseDetail(pathV) {
  349. return Http.request({
  350. url: `/education/app/courseSchedule/getInfo/${pathV}`,
  351. method: 'GET',
  352. })
  353. }
  354. //获取录播信息
  355. static getRecordedLesson(data) {
  356. return Http.request({
  357. url: '/education/app/recordedLesson/selectRecordedLessonByStuIdScheduleId',
  358. method: 'GET',
  359. data
  360. })
  361. }
  362. //签到
  363. static checkIn(scheduleId, studentId, wifiName) {
  364. return Http.request({
  365. url: `/education/app/signIn/insertStudentSign?scheduleId=${scheduleId}&studentId=${studentId}&wifiName=${wifiName}`,
  366. method: 'POST',
  367. })
  368. }
  369. // 提交录播课学习进度
  370. static changeVideoProgress(data) {
  371. return Http.request({
  372. url: '/education/app/recordedLesson/updateRecordedLessonById',
  373. method: 'GET',
  374. data
  375. })
  376. }
  377. //老师
  378. static getTeacher(pathV, isLoading) {
  379. return Http.request({
  380. url: `/resource/app/teacher/${pathV}`,
  381. method: 'GET',
  382. opt: {isLoading}
  383. })
  384. }
  385. //上报连麦成功
  386. static uploadLinkOk(data) {
  387. return Http.request({
  388. url: '/education/integralDetails/integralRuleFour',
  389. method: 'GET',
  390. data
  391. })
  392. }
  393. //获取学员信息
  394. static getUserInfo() {
  395. return Http.request({
  396. url: '/resource/app/student/getInfo',
  397. method: 'GET',
  398. })
  399. }
  400. //获取班级-学员信息
  401. static getUserInfoByTeam(data) {
  402. return Http.request({
  403. url: '/resource/app/student/selectStudentByIdAndTeamId',
  404. method: 'GET',
  405. data
  406. })
  407. }
  408. //修改用户信息
  409. static changeUserInfo(data) {
  410. return Http.request({
  411. url: '/resource/app/student/update',
  412. method: 'GET',
  413. data
  414. })
  415. }
  416. // 修改手机号
  417. static updatePhone(data, isLoading) {
  418. return Http.request({
  419. url: '/resource/app/student/updatePhone',
  420. method: 'GET',
  421. data,
  422. opt: {isLoading}
  423. })
  424. }
  425. //获取当前学员兑换的积分课
  426. static getScoreList(data) {
  427. return Http.request({
  428. url: '/resource/app/integralCrouse/selectChangeCourseList',
  429. method: 'GET',
  430. data
  431. })
  432. }
  433. //获取当前学员未兑换的积分课
  434. static getNoScoreList(data) {
  435. return Http.request({
  436. url: '/resource/app/integralCrouse/selectNoChangeCourseList',
  437. method: 'GET',
  438. data
  439. })
  440. }
  441. //获取积分课
  442. static getScore(pathV, isLoading) {
  443. return Http.request({
  444. url: `/resource/app/integralCrouse/${pathV}`,
  445. method: 'GET',
  446. opt: {isLoading}
  447. })
  448. }
  449. //获取积分信息
  450. static getScoreInfo(isLoading) {
  451. return Http.request({
  452. url: '/education/app/integralDetails/selectItemSurplusValueByIdCard',
  453. method: 'GET',
  454. opt: {isLoading}
  455. })
  456. }
  457. //获取积分明细
  458. static getScoreDetail(data) {
  459. return Http.request({
  460. url: '/education/app/integralDetails/selectMiniIntegralDetailsByIntegralType',
  461. method: 'GET',
  462. data
  463. })
  464. }
  465. //兑换积分
  466. static useScore(data, isLoading) {
  467. return Http.request({
  468. url: '/education/app/integralDetails/insertIntegralCourseByEducationStuId',
  469. method: 'GET',
  470. data,
  471. opt: {isLoading}
  472. })
  473. }
  474. //获取我的考试列表
  475. static getPaperList(data) {
  476. return Http.request({
  477. url: '/resource/app/paper/selStuPaperList',
  478. method: 'GET',
  479. data
  480. })
  481. }
  482. //获取考试试卷详情
  483. static getPaper(pathV, isLoading) {
  484. return Http.request({
  485. url: `/resource/app/paper/${pathV}`,
  486. method: 'GET',
  487. opt: {isLoading}
  488. })
  489. }
  490. //获取考试结果
  491. static getPaperResult(pathV, pathV2, isLoading) {
  492. return Http.request({
  493. url: `/resource/app/paper/echopaper/${pathV}/${pathV2}`,
  494. method: 'GET',
  495. opt: {isLoading}
  496. })
  497. }
  498. //获取问卷结果
  499. static getQuestionResult(data, isLoading) {
  500. return Http.request({
  501. url: `/education/app/answerSheet/getYourAnswer`,
  502. method: 'GET',
  503. data,
  504. opt: {isLoading}
  505. })
  506. }
  507. //提交答案
  508. static putPaper(data, isLoading) {
  509. return Http.request({
  510. url: '/education/app/answerSheet/add',
  511. method: 'POST',
  512. data,
  513. opt: {isLoading}
  514. })
  515. }
  516. //获取我的问卷列表
  517. static getQuestionList(data) {
  518. return Http.request({
  519. url: '/resource/app/questionnaire/stuQuestionnairelist',
  520. method: 'GET',
  521. data
  522. })
  523. }
  524. //获取问卷详情
  525. static getQuestion(pathV, isLoading) {
  526. return Http.request({
  527. url: `/resource/app/questionnaire/${pathV}`,
  528. method: 'GET',
  529. opt: {isLoading}
  530. })
  531. }
  532. //提交问卷
  533. static putQuestion(data, isLoading) {
  534. return Http.request({
  535. url: '/education/app/questionnaireSheet/add',
  536. method: 'POST',
  537. data,
  538. opt: {isLoading}
  539. })
  540. }
  541. // 获取推荐项目
  542. // 0 未报名 1 已报名
  543. static getRecommend(data) {
  544. return Http.request({
  545. url: `/education/app/item/selSignedUpRecommendItem/${data.type}`,
  546. method: 'GET',
  547. data
  548. })
  549. }
  550. // 获取推荐项目详情
  551. static getRecommendInfo(id, isLoading) {
  552. return Http.request({
  553. url: `/education/app/item/selSignedUpRecommendItemTeamInfo/${id}`,
  554. method: 'GET',
  555. opt: {isLoading}
  556. })
  557. }
  558. // 推荐项目报名
  559. static signUp(data, isLoading) {
  560. return Http.request({
  561. url: '/education/app/student/signUp',
  562. method: 'POST',
  563. data,
  564. opt: {isLoading}
  565. })
  566. }
  567. //获取我的消息
  568. static getMsgList(data) {
  569. return Http.request({
  570. url: '/management/app/messageLog/list',
  571. method: 'GET',
  572. data
  573. })
  574. }
  575. //获取app信息
  576. static getHelpInfo(pathV, isLoading) {
  577. return Http.request({
  578. url: `/education/app/home/homeIndex/appInfo/${pathV}`,
  579. method: 'GET',
  580. opt: {isLoading}
  581. })
  582. }
  583. //获取社区互动首页信息
  584. static getTrainIndex(isLoading) {
  585. return Http.request({
  586. url: '/community/app/train/manage/queryTrainInfo',
  587. method: 'GET',
  588. opt: {isLoading}
  589. })
  590. }
  591. // 获取消息动态
  592. static getMyMessage(data) {
  593. return Http.request({
  594. url: '/community/app/train/detail/queryAllList',
  595. method: 'GET',
  596. data
  597. })
  598. }
  599. //获取我的发布
  600. static getTrainList(data) {
  601. return Http.request({
  602. url: '/community/app/train/manage/list',
  603. method: 'GET',
  604. data
  605. })
  606. }
  607. // 获取我的发布每一条详情
  608. static getTrainListDetail(data, isLoading) {
  609. return Http.request({
  610. url: '/community/app/train/manage/queryInfo',
  611. method: 'GET',
  612. data,
  613. opt: {isLoading}
  614. })
  615. }
  616. // 获取我的评论
  617. static getMyComment(data) {
  618. return Http.request({
  619. url: '/community/app/train/detail/list',
  620. method: 'GET',
  621. data
  622. })
  623. }
  624. // 发布评论
  625. static ReleaseComment(data, isLoading) {
  626. return Http.request({
  627. url: '/community/app/train/detail',
  628. method: 'POST',
  629. data,
  630. opt: {isLoading}
  631. })
  632. }
  633. //获取培训方向,培训形式,课程类型,典型分类数据 sys_train_direct、sys_train_form、sys_kc_type、sys_example_type,wifi_config
  634. static getPulishDict(pathV, isLoading) {
  635. return Http.request({
  636. url: `/system/app/home/dict/data/type/${pathV}`,
  637. method: 'GET',
  638. opt: {isLoading}
  639. })
  640. }
  641. // 发布培训需求
  642. static ReleaseNeeds(data, isLoading) {
  643. return Http.request({
  644. url: '/community/app/train/manage',
  645. method: 'POST',
  646. data,
  647. opt: {isLoading}
  648. })
  649. }
  650. // 发布热点难点
  651. static ReleaseHot(data, isLoading) {
  652. return Http.request({
  653. url: '/community/app/focusIssues/add',
  654. method: 'POST',
  655. data,
  656. opt: {isLoading}
  657. })
  658. }
  659. // 发布典型案例
  660. static ReleaseExamples(data, isLoading) {
  661. return Http.request({
  662. url: '/community/app/example',
  663. method: 'POST',
  664. data,
  665. opt: {isLoading}
  666. })
  667. }
  668. // 查询四级行政区
  669. static getRegionList(data) {
  670. return Http.request({
  671. url: '/system/app/home/region/list',
  672. method: 'GET',
  673. data
  674. })
  675. }
  676. // 查询单位
  677. static getUnitList(data) {
  678. return Http.request({
  679. url: '/system/app/home/unit/list',
  680. method: 'GET',
  681. data
  682. })
  683. }
  684. // 根据code查上级行政id 和 单位id
  685. static getRegionByCode(data) {
  686. return Http.request({
  687. url: '/system/app/home/region/infos',
  688. method: 'GET',
  689. data
  690. });
  691. }
  692. // 获取学员手册资料
  693. static getBook(data, isLoading) {
  694. return Http.request({
  695. url: '/education/app/manual/list',
  696. method: 'GET',
  697. data,
  698. opt: {isLoading}
  699. })
  700. }
  701. // 通过索引获取学员手册
  702. static getStudentBookByIndex(index) {
  703. return Http.request({
  704. url: `/education/app/manualConfig/infos/${index}`,
  705. method: 'GET'
  706. });
  707. }
  708. // 学员手册日程安排
  709. static studentBookSchedule(data) {
  710. return Http.request({
  711. url: '/education/app/classScheduleCard/list',
  712. method: 'GET',
  713. data
  714. });
  715. }
  716. // 学员手册座位图
  717. static studentBookSeat(params) {
  718. return Http.request({
  719. url: `/education/app/courseSchedule/infos/${params}`,
  720. method: 'GET'
  721. });
  722. }
  723. // 学员手册 学员名单
  724. static studentBookLists(data) {
  725. return Http.request({
  726. url: '/education/app/student/studentNameList',
  727. method: 'GET',
  728. data
  729. });
  730. }
  731. // 学员手册 项目组名单
  732. static studentBookGroups(id) {
  733. return Http.request({
  734. url: `/education/app/team/infos/${id}`,
  735. method: 'GET'
  736. });
  737. }
  738. // 学员手册 教师简介
  739. static studentBookTeacher(url) {
  740. return Http.request({
  741. url: `/resource/app/teacher/queryTeacherInfos/${url}`,
  742. method: 'GET'
  743. });
  744. }
  745. //学员手册 基地介绍
  746. static studentBaseLibrary(url) {
  747. return Http.request({
  748. url: `/resource/manage/app/library/queryBaseLibraryDesc/${url}`,
  749. method: 'GET'
  750. })
  751. }
  752. //获取课程是否开启
  753. static getCourseOpenStatus(scheduleId) {
  754. return Http.request({
  755. url: `/education/app/courseSchedule/getTimer`,
  756. method: 'GET',
  757. data: {
  758. scheduleId
  759. }
  760. });
  761. }
  762. }
  763. export default Api