api.js 20 KB

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