@x-edu/live-player 0.0.33 → 0.0.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/XEduLivePlayer.common.js +999 -11203
- package/dist/XEduLivePlayerPre.common.js +1147 -11712
- package/package.json +5 -2
- package/.browserslistrc +0 -10
- package/.eslintignore +0 -8
- package/.eslintrc.js +0 -26
- package/.gem-mine +0 -11
- package/.postcssrc.js +0 -6
- package/babel.config.js +0 -33
- package/doc/develop.md +0 -24
- package/gem-mine.config.js +0 -86
- package/jest.config.js +0 -9
- package/jsconfig.json +0 -15
- package/mock/helper.js +0 -8
- package/mock/index.js +0 -34
- package/public/.well-known/apple-app-site-association +0 -1
- package/public/3rd/ali-player/alipayercomponents-1.0.8.min.js +0 -26
- package/public/3rd/ali-player/aliplayer-hls-min.js +0 -28
- package/public/3rd/ali-player/aliplayer-min.css +0 -1
- package/public/3rd/ali-player/aliplayer-min.js +0 -2
- package/public/3rd/ali-player/img/fullscreen.png +0 -0
- package/public/3rd/ali-player/img/playanimation.png +0 -0
- package/public/3rd/ali-player/img/smallscreen.png +0 -0
- package/public/3rd/ali-player/img/volume.png +0 -0
- package/public/3rd/im-web-push/index.umd.js +0 -14
- package/public/JsBridge.js +0 -1602
- package/public/fish/editor/lang/zh-cn/zh-cn.min.js +0 -1
- package/public/fish/editor/loading.gif +0 -0
- package/public/fish/editor/themes/default/css/ueditor.css +0 -1906
- package/public/fish/editor/themes/default/images/icons.png +0 -0
- package/public/fish/editor/themes/default/images/scale.png +0 -0
- package/public/fish/editor/themes/default/images/spacer.gif +0 -0
- package/public/fish/editor/themes/default/images/videologo.gif +0 -0
- package/public/fish/editor/themes/iframe.css +0 -0
- package/public/fish/editor/third-party/codemirror/codemirror.css +0 -104
- package/public/fish/editor/third-party/codemirror/codemirror.js +0 -3581
- package/public/fish/editor/third-party/zeroclipboard/ZeroClipboard.js +0 -1256
- package/public/fish/editor/ueditor.all.min.js +0 -17
- package/public/fish/editor/ueditor.config.js +0 -467
- package/public/fish/icon/umd-4.1.2.js +0 -2
- package/public/fish/video/icon_active.gif +0 -0
- package/public/fish/video/videoplayer.min.css +0 -7
- package/public/fish/video/videoplayer.min.js +0 -32
- package/public/fish/video/zh-CN.js +0 -83
- package/public/icon/demo.css +0 -539
- package/public/icon/demo_index.html +0 -2189
- package/public/icon/iconfont.css +0 -363
- package/public/icon/iconfont.js +0 -1
- package/public/icon/iconfont.json +0 -618
- package/public/icon/iconfont.ttf +0 -0
- package/public/icon/iconfont.woff +0 -0
- package/public/icon/iconfont.woff2 +0 -0
- package/public/index.html +0 -50
- package/script/image/readme.md +0 -77
- package/script/postcss.js +0 -48
- package/src/App.jsx +0 -24
- package/src/asset/img/activeBanner//342/200/234/345/217/214/345/207/217/342/200/235/345/267/245/344/275/234.png +0 -0
- package/src/asset/img/activeBanner//344/271/211/345/212/241/346/225/231/350/202/262.png +0 -0
- package/src/asset/img/activeBanner//344/274/230/347/247/200/344/274/240/347/273/237/346/226/207/345/214/226.png +0 -0
- package/src/asset/img/activeBanner//344/275/223/350/202/262/351/224/273/347/202/274.png +0 -0
- package/src/asset/img/activeBanner//345/205/232/345/217/262/345/255/246/344/271/240.png +0 -0
- package/src/asset/img/activeBanner//345/205/232/345/273/272/345/276/267/350/202/262.png +0 -0
- package/src/asset/img/activeBanner//345/212/263/345/212/250/345/205/211/350/215/243.png +0 -0
- package/src/asset/img/activeBanner//345/212/263/345/212/250/345/257/274/350/210/252.png +0 -0
- package/src/asset/img/activeBanner//345/212/263/345/212/250/346/225/231/350/202/262.png +0 -0
- package/src/asset/img/activeBanner//345/212/263/345/212/250/346/231/272/346/205/247.png +0 -0
- package/src/asset/img/activeBanner//345/223/201/345/276/267/346/225/231/350/202/262.png +0 -0
- package/src/asset/img/activeBanner//345/255/246/345/211/215/346/225/231/350/202/262.png +0 -0
- package/src/asset/img/activeBanner//345/256/252/346/263/225/346/263/225/346/262/273.png +0 -0
- package/src/asset/img/activeBanner//345/256/266/345/272/255/346/225/231/350/202/262/346/214/207/345/257/274.png +0 -0
- package/src/asset/img/activeBanner//345/256/266/345/272/255/346/225/231/350/202/262/346/226/271/346/263/225.png +0 -0
- package/src/asset/img/activeBanner//345/256/266/345/272/255/346/225/231/350/202/262/350/247/202/345/277/265.png +0 -0
- package/src/asset/img/activeBanner//345/275/261/350/247/206/346/225/231/350/202/262.png +0 -0
- package/src/asset/img/activeBanner//345/277/203/347/220/206/345/201/245/345/272/267.png +0 -0
- package/src/asset/img/activeBanner//346/200/235/346/224/277/350/257/276/347/250/213.png +0 -0
- package/src/asset/img/activeBanner//346/225/231/345/255/246/346/210/220/346/236/234.png +0 -0
- package/src/asset/img/activeBanner//346/225/231/346/235/220/344/270/223/345/214/272.png +0 -0
- package/src/asset/img/activeBanner//346/225/231/350/202/262/344/277/241/346/201/257/345/214/226.png +0 -0
- package/src/asset/img/activeBanner//346/226/207/345/214/226/350/211/272/346/234/257.png +0 -0
- package/src/asset/img/activeBanner//346/231/256/351/200/232/351/253/230/344/270/255.png +0 -0
- package/src/asset/img/activeBanner//347/210/261/345/233/275/344/270/273/344/271/211.png +0 -0
- package/src/asset/img/activeBanner//347/211/271/346/256/212/346/225/231/350/202/262.png +0 -0
- package/src/asset/img/activeBanner//347/224/237/345/221/275/344/270/216/345/256/211/345/205/250.png +0 -0
- package/src/asset/img/activeBanner//347/224/237/346/200/201/346/226/207/346/230/216.png +0 -0
- package/src/asset/img/activeBanner//347/240/224/345/255/246/345/256/236/350/267/265.png +0 -0
- package/src/asset/img/activeBanner//347/247/221/346/231/256/346/225/231/350/202/262.png +0 -0
- package/src/asset/img/activeBanner//347/273/217/345/205/270/351/230/205/350/257/273.png +0 -0
- package/src/asset/img/activeBanner//347/273/274/345/220/210/346/224/271/351/235/251.png +0 -0
- package/src/asset/img/advertisement.png +0 -0
- package/src/asset/img/bg-block.png +0 -0
- package/src/asset/img/bookhover.png +0 -0
- package/src/asset/img/card.png +0 -0
- package/src/asset/img/catalog/article.png +0 -0
- package/src/asset/img/catalog/audio.png +0 -0
- package/src/asset/img/catalog/course.png +0 -0
- package/src/asset/img/catalog/document.png +0 -0
- package/src/asset/img/catalog/image.png +0 -0
- package/src/asset/img/catalog/link.png +0 -0
- package/src/asset/img/catalog/openClassLive.png +0 -0
- package/src/asset/img/catalog/other.png +0 -0
- package/src/asset/img/catalog/video.png +0 -0
- package/src/asset/img/class-live-header-icon.png +0 -0
- package/src/asset/img/content/article.png +0 -0
- package/src/asset/img/content/document.png +0 -0
- package/src/asset/img/content/image.png +0 -0
- package/src/asset/img/content/url.png +0 -0
- package/src/asset/img/content/video.png +0 -0
- package/src/asset/img/contentType/default.png +0 -0
- package/src/asset/img/contentType/x_article.png +0 -0
- package/src/asset/img/contentType/x_audio_video.png +0 -0
- package/src/asset/img/contentType/x_course.png +0 -0
- package/src/asset/img/contentType/x_document.png +0 -0
- package/src/asset/img/contentType/x_image_list.png +0 -0
- package/src/asset/img/course/book.svg +0 -1
- package/src/asset/img/course/courseBg.png +0 -0
- package/src/asset/img/course/default.png +0 -0
- package/src/asset/img/course/document.png +0 -0
- package/src/asset/img/course/done.png +0 -0
- package/src/asset/img/course/file_doc.svg +0 -1
- package/src/asset/img/course/file_doc_active.svg +0 -1
- package/src/asset/img/course/file_video.svg +0 -1
- package/src/asset/img/course/file_video_active.svg +0 -1
- package/src/asset/img/course/icon_checkbox_linear.svg +0 -1
- package/src/asset/img/course/icondown.png +0 -0
- package/src/asset/img/course/learning.png +0 -0
- package/src/asset/img/course/lecturerDefault.png +0 -0
- package/src/asset/img/course/nolearn.png +0 -0
- package/src/asset/img/course/noplay.png +0 -0
- package/src/asset/img/course/pause.png +0 -0
- package/src/asset/img/course/people.png +0 -0
- package/src/asset/img/course/play.png +0 -0
- package/src/asset/img/course/playing.svg +0 -22
- package/src/asset/img/course/reload.png +0 -0
- package/src/asset/img/course/shouqi_icon.png +0 -0
- package/src/asset/img/course/test.png +0 -0
- package/src/asset/img/course/video.png +0 -0
- package/src/asset/img/def/resource_def.png +0 -0
- package/src/asset/img/def/studio_def.png +0 -0
- package/src/asset/img/def-avatar.jpg +0 -0
- package/src/asset/img/download-active.png +0 -0
- package/src/asset/img/download.png +0 -0
- package/src/asset/img/eduReform/djdy-cover.png +0 -0
- package/src/asset/img/eduReform/djdy.png +0 -0
- package/src/asset/img/eduReform/jxcg-1.png +0 -0
- package/src/asset/img/eduReform/jxcg-2.png +0 -0
- package/src/asset/img/eduReform/jxcg-3.png +0 -0
- package/src/asset/img/eduReform/jxcg-4.png +0 -0
- package/src/asset/img/eduReform/jxcg-cover.png +0 -0
- package/src/asset/img/eduReform/jxgg.png +0 -0
- package/src/asset/img/eduReform/jyxxh-cover.png +0 -0
- package/src/asset/img/eduReform/jyxxh.png +0 -0
- package/src/asset/img/eduReform/ptgz-cover.png +0 -0
- package/src/asset/img/eduReform/ptgz.png +0 -0
- package/src/asset/img/eduReform/sjgz-cover.png +0 -0
- package/src/asset/img/eduReform/sjgz.png +0 -0
- package/src/asset/img/eduReform/tsjy-cover.png +0 -0
- package/src/asset/img/eduReform/tsjy.png +0 -0
- package/src/asset/img/eduReform/xqjy-1.png +0 -0
- package/src/asset/img/eduReform/xqjy-2.png +0 -0
- package/src/asset/img/eduReform/xqjy-3.png +0 -0
- package/src/asset/img/eduReform/xqjy-4.png +0 -0
- package/src/asset/img/eduReform/xqjy-cover.png +0 -0
- package/src/asset/img/eduReform/xqjy.png +0 -0
- package/src/asset/img/eduReform/ywjy-1.png +0 -0
- package/src/asset/img/eduReform/ywjy-2.png +0 -0
- package/src/asset/img/eduReform/ywjy-cover.png +0 -0
- package/src/asset/img/eduReform/ywjy.png +0 -0
- package/src/asset/img/eduReform/zhgg-1.png +0 -0
- package/src/asset/img/eduReform/zhgg-2.png +0 -0
- package/src/asset/img/eduReform/zhgg-cover.png +0 -0
- package/src/asset/img/eduReform/zhgg.png +0 -0
- package/src/asset/img/family/1.jpg +0 -0
- package/src/asset/img/family/ff-1.png +0 -0
- package/src/asset/img/family/ff-2.png +0 -0
- package/src/asset/img/family/ff-3.png +0 -0
- package/src/asset/img/family/ff-cover.png +0 -0
- package/src/asset/img/family/gn-1.png +0 -0
- package/src/asset/img/family/gn-2.png +0 -0
- package/src/asset/img/family/gn-3.png +0 -0
- package/src/asset/img/family/gn-cover.png +0 -0
- package/src/asset/img/family/icon/jyff.png +0 -0
- package/src/asset/img/family/icon/jygn.png +0 -0
- package/src/asset/img/family/icon/jyzd.png +0 -0
- package/src/asset/img/family/zd-1.png +0 -0
- package/src/asset/img/family/zd-2.png +0 -0
- package/src/asset/img/family/zd-3.png +0 -0
- package/src/asset/img/family/zd-cover.png +0 -0
- package/src/asset/img/favicon-m.png +0 -0
- package/src/asset/img/favicon.png +0 -0
- package/src/asset/img/icon-course-white.svg +0 -3
- package/src/asset/img/icon-course.svg +0 -3
- package/src/asset/img/icon-eye-white.svg +0 -4
- package/src/asset/img/icon-eye.svg +0 -4
- package/src/asset/img/icon-school-white.svg +0 -3
- package/src/asset/img/icon-school.svg +0 -3
- package/src/asset/img/img-jgsj/10.png +0 -0
- package/src/asset/img/img-jgsj/3.png +0 -0
- package/src/asset/img/img-jgsj/4.png +0 -0
- package/src/asset/img/img-jgsj/5.png +0 -0
- package/src/asset/img/img-jgsj/6.png +0 -0
- package/src/asset/img/img-jgsj/7-1.png +0 -0
- package/src/asset/img/img-jgsj/7-2.png +0 -0
- package/src/asset/img/img-jgsj/8.png +0 -0
- package/src/asset/img/img-jgsj/8s.png +0 -0
- package/src/asset/img/img-jgsj/9.png +0 -0
- package/src/asset/img/img-search-tag-bottom.png +0 -0
- package/src/asset/img/img-ztjy/1.png +0 -0
- package/src/asset/img/img-ztjy/2.png +0 -0
- package/src/asset/img/img-ztjy/3.png +0 -0
- package/src/asset/img/img-ztjy/4.png +0 -0
- package/src/asset/img/img-ztjy/5.png +0 -0
- package/src/asset/img/img-ztjy/6.png +0 -0
- package/src/asset/img/img-ztjy/icon/agzy.png +0 -0
- package/src/asset/img/img-ztjy/icon/dsxx.png +0 -0
- package/src/asset/img/img-ztjy/icon/kcjx.png +0 -0
- package/src/asset/img/img-ztjy/icon/pdjy.png +0 -0
- package/src/asset/img/img-ztjy/icon/smyaq.png +0 -0
- package/src/asset/img/img-ztjy/icon/stwm.png +0 -0
- package/src/asset/img/img-ztjy/icon/xffz.png +0 -0
- package/src/asset/img/img-ztjy/icon/xljk.png +0 -0
- package/src/asset/img/img-ztjy/icon/yxctwh.png +0 -0
- package/src/asset/img/incentives/star.png +0 -0
- package/src/asset/img/juhe-bg.png +0 -0
- package/src/asset/img/left-hover.png +0 -0
- package/src/asset/img/left-nor.png +0 -0
- package/src/asset/img/living-gif-web.gif +0 -0
- package/src/asset/img/loading.svg +0 -52
- package/src/asset/img/person.png +0 -0
- package/src/asset/img/personalCenter/calendar_icon.png +0 -0
- package/src/asset/img/personalCenter/clock.png +0 -0
- package/src/asset/img/personalCenter/cover.jpg +0 -0
- package/src/asset/img/personalCenter/default_cover.png +0 -0
- package/src/asset/img/personalCenter/header_bg.png +0 -0
- package/src/asset/img/personalCenter/video_icon.png +0 -0
- package/src/asset/img/resource/cover.png +0 -0
- package/src/asset/img/resource/more_close.png +0 -0
- package/src/asset/img/resource/more_open.png +0 -0
- package/src/asset/img/resource/remove.png +0 -0
- package/src/asset/img/resource/tags.png +0 -0
- package/src/asset/img/resource/upload.png +0 -0
- package/src/asset/img/resource//346/211/271/351/207/217/347/274/226/350/276/221@2x.png +0 -0
- package/src/asset/img/right-hover.png +0 -0
- package/src/asset/img/right-icon.png +0 -0
- package/src/asset/img/right-nor.png +0 -0
- package/src/asset/img/schoolService/jdyd-1.png +0 -0
- package/src/asset/img/schoolService/jdyd-2.png +0 -0
- package/src/asset/img/schoolService/jdyd-3.png +0 -0
- package/src/asset/img/schoolService/jdyd-cover.png +0 -0
- package/src/asset/img/schoolService/jdyd.png +0 -0
- package/src/asset/img/schoolService/kpjy-1.png +0 -0
- package/src/asset/img/schoolService/kpjy-2.png +0 -0
- package/src/asset/img/schoolService/kpjy-3.png +0 -0
- package/src/asset/img/schoolService/kpjy-cover.png +0 -0
- package/src/asset/img/schoolService/kpjy.png +0 -0
- package/src/asset/img/schoolService/tydl-1.png +0 -0
- package/src/asset/img/schoolService/tydl-2.png +0 -0
- package/src/asset/img/schoolService/tydl-3.png +0 -0
- package/src/asset/img/schoolService/tydl-cover.png +0 -0
- package/src/asset/img/schoolService/tydl.png +0 -0
- package/src/asset/img/schoolService/whys-1.png +0 -0
- package/src/asset/img/schoolService/whys-2.png +0 -0
- package/src/asset/img/schoolService/whys-3.png +0 -0
- package/src/asset/img/schoolService/whys-4.png +0 -0
- package/src/asset/img/schoolService/whys-cover.png +0 -0
- package/src/asset/img/schoolService/whys.png +0 -0
- package/src/asset/img/schoolService/ysjy-1.png +0 -0
- package/src/asset/img/schoolService/ysjy-2.png +0 -0
- package/src/asset/img/schoolService/ysjy-3.png +0 -0
- package/src/asset/img/schoolService/ysjy-4.png +0 -0
- package/src/asset/img/schoolService/ysjy-cover.png +0 -0
- package/src/asset/img/schoolService/ysjy.png +0 -0
- package/src/asset/img/schoolService/yxjy-cover.png +0 -0
- package/src/asset/img/schoolService/yxsj-1.png +0 -0
- package/src/asset/img/schoolService/yxsj-2.png +0 -0
- package/src/asset/img/schoolService/yxsj-3.png +0 -0
- package/src/asset/img/schoolService/yxsj.png +0 -0
- package/src/asset/img/sedu/catalog/list.png +0 -0
- package/src/asset/img/sedu/icon/agzy-prefix.png +0 -0
- package/src/asset/img/sedu/icon/agzy.png +0 -0
- package/src/asset/img/sedu/icon/arrow-hover.png +0 -0
- package/src/asset/img/sedu/icon/arrow.png +0 -0
- package/src/asset/img/sedu/icon/dsxx-prefix.png +0 -0
- package/src/asset/img/sedu/icon/dsxx.png +0 -0
- package/src/asset/img/sedu/icon/epidemic-prevention-bg.png +0 -0
- package/src/asset/img/sedu/icon/epidemic-prevention.png +0 -0
- package/src/asset/img/sedu/icon/family-bg.png +0 -0
- package/src/asset/img/sedu/icon/family.png +0 -0
- package/src/asset/img/sedu/icon/film-bg.png +0 -0
- package/src/asset/img/sedu/icon/film.png +0 -0
- package/src/asset/img/sedu/icon/go-more-hover.png +0 -0
- package/src/asset/img/sedu/icon/go-more.png +0 -0
- package/src/asset/img/sedu/icon/kcjx.png +0 -0
- package/src/asset/img/sedu/icon/ldjy-prefix.png +0 -0
- package/src/asset/img/sedu/icon/life-safe-bg.png +0 -0
- package/src/asset/img/sedu/icon/life-safe.png +0 -0
- package/src/asset/img/sedu/icon/morality-bg.png +0 -0
- package/src/asset/img/sedu/icon/morality.png +0 -0
- package/src/asset/img/sedu/icon/more-bg.png +0 -0
- package/src/asset/img/sedu/icon/more.png +0 -0
- package/src/asset/img/sedu/icon/party-history-bg.png +0 -0
- package/src/asset/img/sedu/icon/party-history.png +0 -0
- package/src/asset/img/sedu/icon/pdjy-prefix.png +0 -0
- package/src/asset/img/sedu/icon/pdjy.png +0 -0
- package/src/asset/img/sedu/icon/psychological-bg.png +0 -0
- package/src/asset/img/sedu/icon/psychological.png +0 -0
- package/src/asset/img/sedu/icon/read-bg.png +0 -0
- package/src/asset/img/sedu/icon/read.png +0 -0
- package/src/asset/img/sedu/icon/smaq-prefix.png +0 -0
- package/src/asset/img/sedu/icon/smyaq.png +0 -0
- package/src/asset/img/sedu/icon/study-bg.png +0 -0
- package/src/asset/img/sedu/icon/study.png +0 -0
- package/src/asset/img/sedu/icon/stwm-prefix.png +0 -0
- package/src/asset/img/sedu/icon/stwm.png +0 -0
- package/src/asset/img/sedu/icon/xffz-prefix.png +0 -0
- package/src/asset/img/sedu/icon/xffz.png +0 -0
- package/src/asset/img/sedu/icon/xljk-prefix.png +0 -0
- package/src/asset/img/sedu/icon/xljk.png +0 -0
- package/src/asset/img/sedu/icon/yxctwh-prefix.png +0 -0
- package/src/asset/img/sedu/icon/yxctwh.png +0 -0
- package/src/asset/img/sedu/nav_new/agzy-1.png +0 -0
- package/src/asset/img/sedu/nav_new/agzy-2.png +0 -0
- package/src/asset/img/sedu/nav_new/agzy-3.png +0 -0
- package/src/asset/img/sedu/nav_new/agzy-cover.png +0 -0
- package/src/asset/img/sedu/nav_new/agzy.png +0 -0
- package/src/asset/img/sedu/nav_new/dsxx-1.png +0 -0
- package/src/asset/img/sedu/nav_new/dsxx-2.png +0 -0
- package/src/asset/img/sedu/nav_new/dsxx-3.png +0 -0
- package/src/asset/img/sedu/nav_new/dsxx-cover.png +0 -0
- package/src/asset/img/sedu/nav_new/dsxx.png +0 -0
- package/src/asset/img/sedu/nav_new/jdwy-1.png +0 -0
- package/src/asset/img/sedu/nav_new/jdwy-2.png +0 -0
- package/src/asset/img/sedu/nav_new/jdwy-3.png +0 -0
- package/src/asset/img/sedu/nav_new/ldjy-1.png +0 -0
- package/src/asset/img/sedu/nav_new/ldjy-2.png +0 -0
- package/src/asset/img/sedu/nav_new/ldjy-3.png +0 -0
- package/src/asset/img/sedu/nav_new/ldjy-cover.png +0 -0
- package/src/asset/img/sedu/nav_new/ldjy.png +0 -0
- package/src/asset/img/sedu/nav_new/pdjy-1.png +0 -0
- package/src/asset/img/sedu/nav_new/pdjy-2.png +0 -0
- package/src/asset/img/sedu/nav_new/pdjy-3.png +0 -0
- package/src/asset/img/sedu/nav_new/pdjy-cover.png +0 -0
- package/src/asset/img/sedu/nav_new/pdjy.png +0 -0
- package/src/asset/img/sedu/nav_new/smyaq-1.png +0 -0
- package/src/asset/img/sedu/nav_new/smyaq-2.png +0 -0
- package/src/asset/img/sedu/nav_new/smyaq-3.png +0 -0
- package/src/asset/img/sedu/nav_new/smyaq-4.png +0 -0
- package/src/asset/img/sedu/nav_new/smyaq-cover.png +0 -0
- package/src/asset/img/sedu/nav_new/smyaq.png +0 -0
- package/src/asset/img/sedu/nav_new/stwm-1.png +0 -0
- package/src/asset/img/sedu/nav_new/stwm-2.png +0 -0
- package/src/asset/img/sedu/nav_new/stwm-3.png +0 -0
- package/src/asset/img/sedu/nav_new/stwm-cover.png +0 -0
- package/src/asset/img/sedu/nav_new/stwm.png +0 -0
- package/src/asset/img/sedu/nav_new/xffz-1.png +0 -0
- package/src/asset/img/sedu/nav_new/xffz-2.png +0 -0
- package/src/asset/img/sedu/nav_new/xffz-3.png +0 -0
- package/src/asset/img/sedu/nav_new/xffz-4.png +0 -0
- package/src/asset/img/sedu/nav_new/xffz-cover.png +0 -0
- package/src/asset/img/sedu/nav_new/xffz.png +0 -0
- package/src/asset/img/sedu/nav_new/xljk-1.png +0 -0
- package/src/asset/img/sedu/nav_new/xljk-2.png +0 -0
- package/src/asset/img/sedu/nav_new/xljk-3.png +0 -0
- package/src/asset/img/sedu/nav_new/xljk-cover.png +0 -0
- package/src/asset/img/sedu/nav_new/xljk.png +0 -0
- package/src/asset/img/sedu/nav_new/yxctwh-1.png +0 -0
- package/src/asset/img/sedu/nav_new/yxctwh-2.png +0 -0
- package/src/asset/img/sedu/nav_new/yxctwh-3.png +0 -0
- package/src/asset/img/sedu/nav_new/zgwhct-cover.png +0 -0
- package/src/asset/img/sedu/nav_new/zgwhct.png +0 -0
- package/src/asset/img/star.png +0 -0
- package/src/asset/img/star_filled.png +0 -0
- package/src/asset/img/star_hover.png +0 -0
- package/src/asset/img/up-hover.png +0 -0
- package/src/asset/img/up-nor.png +0 -0
- package/src/asset/img/video-play.svg +0 -6
- package/src/asset/style/background.less +0 -20
- package/src/asset/style/banner.less +0 -36
- package/src/asset/style/base.less +0 -74
- package/src/asset/style/index.less +0 -114
- package/src/asset/style/reset-theme.less +0 -142
- package/src/asset/style/theme/index.less +0 -55
- package/src/asset/style/theme/party/global.less +0 -20
- package/src/asset/style/theme/party/img/footer-bg.png +0 -0
- package/src/asset/style/theme/party/img/header-bg-1.png +0 -0
- package/src/asset/style/theme/party/img/header-bg-2.png +0 -0
- package/src/asset/style/theme/party/img/header-bg.png +0 -0
- package/src/asset/style/theme/party/img/logo.png +0 -0
- package/src/asset/style/theme/party/override.less +0 -57
- package/src/asset/style/theme/test/global.less +0 -18
- package/src/asset/style/theme/test/img/footer-bg.png +0 -0
- package/src/asset/style/theme/test/img/header-bg-1.png +0 -0
- package/src/asset/style/theme/test/img/header-bg-2.png +0 -0
- package/src/asset/style/theme/test/img/header-bg.png +0 -0
- package/src/asset/style/theme/test/img/logo.png +0 -0
- package/src/asset/style/theme/test/override.less +0 -45
- package/src/asset/style/variable.less +0 -12
- package/src/component/AliPlayer/index.jsx +0 -49
- package/src/component/Avatar/index.jsx +0 -50
- package/src/component/Empty/img/empty.png +0 -0
- package/src/component/Empty/index.jsx +0 -34
- package/src/component/Empty/index.module.less +0 -37
- package/src/component/IMChatroom/asset/style/images/welcome-m.png +0 -0
- package/src/component/IMChatroom/asset/style/images/welcome.png +0 -0
- package/src/component/IMChatroom/asset/style/index.module.less +0 -0
- package/src/component/IMChatroom/component/status/403.jsx +0 -13
- package/src/component/IMChatroom/component/status/404.jsx +0 -13
- package/src/component/IMChatroom/component/status/Error.jsx +0 -23
- package/src/component/IMChatroom/component/status/Loading.jsx +0 -5
- package/src/component/IMChatroom/config/app/config.js +0 -118
- package/src/component/IMChatroom/config/app/index.js +0 -60
- package/src/component/IMChatroom/config/env.js +0 -5
- package/src/component/IMChatroom/config/index.js +0 -3
- package/src/component/IMChatroom/config/request/config/base.js +0 -124
- package/src/component/IMChatroom/config/request/config/chatroom.js +0 -26
- package/src/component/IMChatroom/config/request/config/imCoreApi.js +0 -21
- package/src/component/IMChatroom/config/request/index.js +0 -21
- package/src/component/IMChatroom/config/request/proxy.js +0 -39
- package/src/component/IMChatroom/config/url.js +0 -7
- package/src/component/IMChatroom/constants/errorCode.js +0 -9
- package/src/component/IMChatroom/constants/index.js +0 -84
- package/src/component/IMChatroom/constants/origin.js +0 -27
- package/src/component/IMChatroom/context/chatroom.js +0 -154
- package/src/component/IMChatroom/context/connect.js +0 -28
- package/src/component/IMChatroom/i18n/en/index.json +0 -73
- package/src/component/IMChatroom/i18n/index.jsx +0 -14
- package/src/component/IMChatroom/i18n/language.js +0 -9
- package/src/component/IMChatroom/i18n/zh-CN/index.json +0 -73
- package/src/component/IMChatroom/index.jsx +0 -49
- package/src/component/IMChatroom/page/chat/index.jsx +0 -27
- package/src/component/IMChatroom/page/chat/messageEditor/index.jsx +0 -375
- package/src/component/IMChatroom/page/chat/messageList/index.jsx +0 -354
- package/src/component/IMChatroom/page/chat/stickedMessage/index.jsx +0 -59
- package/src/component/IMChatroom/page/chat/stickedMessage/style/index.module.less +0 -8
- package/src/component/IMChatroom/page/chat/style/index.module.less +0 -52
- package/src/component/IMChatroom/page/home/connect/index.jsx +0 -188
- package/src/component/IMChatroom/page/home/connect/status.jsx +0 -124
- package/src/component/IMChatroom/page/home/context/cmd.jsx +0 -37
- package/src/component/IMChatroom/page/home/context/index.jsx +0 -67
- package/src/component/IMChatroom/page/home/index.jsx +0 -164
- package/src/component/IMChatroom/page/home/notice/index.jsx +0 -123
- package/src/component/IMChatroom/page/home/notice/style/index.module.less +0 -50
- package/src/component/IMChatroom/page/home/style/images/font-size-active-m.png +0 -0
- package/src/component/IMChatroom/page/home/style/images/font-size-active.png +0 -0
- package/src/component/IMChatroom/page/home/style/images/font-size-m.png +0 -0
- package/src/component/IMChatroom/page/home/style/images/font-size.png +0 -0
- package/src/component/IMChatroom/page/home/style/images/notice-active-m.png +0 -0
- package/src/component/IMChatroom/page/home/style/images/notice-active.png +0 -0
- package/src/component/IMChatroom/page/home/style/images/notice-m.png +0 -0
- package/src/component/IMChatroom/page/home/style/images/notice.png +0 -0
- package/src/component/IMChatroom/page/home/style/index.module.less +0 -111
- package/src/component/IMChatroom/page/member/index.jsx +0 -15
- package/src/component/IMChatroom/page/member/memberCount/index.jsx +0 -44
- package/src/component/IMChatroom/page/member/memberList/index.jsx +0 -121
- package/src/component/IMChatroom/page/member/style/index.module.less +0 -3
- package/src/component/IMChatroom/sdk/bridge.js +0 -39
- package/src/component/IMChatroom/sdk/cs/constants.js +0 -20
- package/src/component/IMChatroom/sdk/cs/index.js +0 -101
- package/src/component/IMChatroom/sdk/imChatroom.js +0 -15
- package/src/component/IMChatroom/sdk/imcore/constants.js +0 -128
- package/src/component/IMChatroom/sdk/imcore/emitters/chatroomDestroyed.js +0 -5
- package/src/component/IMChatroom/sdk/imcore/emitters/chatroomInfoGetFail.js +0 -5
- package/src/component/IMChatroom/sdk/imcore/emitters/chatroomKickedByAdmin.js +0 -5
- package/src/component/IMChatroom/sdk/imcore/emitters/chatroomKickedBySelf.js +0 -5
- package/src/component/IMChatroom/sdk/imcore/emitters/chatroomLoginFail.js +0 -5
- package/src/component/IMChatroom/sdk/imcore/emitters/chatroomLoginSuccess.js +0 -5
- package/src/component/IMChatroom/sdk/imcore/emitters/chatroomMemberLogin.js +0 -5
- package/src/component/IMChatroom/sdk/imcore/emitters/chatroomMemberLogout.js +0 -5
- package/src/component/IMChatroom/sdk/imcore/emitters/connectionConnected.js +0 -5
- package/src/component/IMChatroom/sdk/imcore/emitters/connectionConnecting.js +0 -5
- package/src/component/IMChatroom/sdk/imcore/emitters/connectionDisconnect.js +0 -5
- package/src/component/IMChatroom/sdk/imcore/emitters/index.js +0 -57
- package/src/component/IMChatroom/sdk/imcore/emitters/messageReceive.js +0 -36
- package/src/component/IMChatroom/sdk/imcore/index.js +0 -178
- package/src/component/IMChatroom/sdk/imcore/interceptors/request.js +0 -7
- package/src/component/IMChatroom/sdk/imcore/interceptors/response.js +0 -5
- package/src/component/IMChatroom/sdk/imcore/plugins/getAuth.js +0 -64
- package/src/component/IMChatroom/sdk/imcore/plugins/getConversationId.js +0 -20
- package/src/component/IMChatroom/sdk/imcore/plugins/getExtInfo.js +0 -10
- package/src/component/IMChatroom/sdk/imcore/plugins/getLoginInfo.js +0 -48
- package/src/component/IMChatroom/sdk/imcore/plugins/getPlatformType.js +0 -12
- package/src/component/IMChatroom/sdk/imcore/plugins/index.js +0 -22
- package/src/component/IMChatroom/sdk/imcore/util/format.js +0 -177
- package/src/component/IMChatroom/sdk/imcore/util/parser.js +0 -35
- package/src/component/IMChatroom/sdk/oms.js +0 -18
- package/src/component/IMChatroom/sdk/uc.js +0 -3
- package/src/component/IMChatroom/subscription/channel/app.js +0 -5
- package/src/component/IMChatroom/subscription/channel/ctl.js +0 -22
- package/src/component/IMChatroom/subscription/channel/member.js +0 -40
- package/src/component/IMChatroom/subscription/channel/message.js +0 -13
- package/src/component/IMChatroom/subscription/channel/ntf.js +0 -86
- package/src/component/IMChatroom/subscription/channel/tel.js +0 -5
- package/src/component/IMChatroom/subscription/channel/websocket.js +0 -5
- package/src/component/IMChatroom/subscription/event.js +0 -37
- package/src/component/IMChatroom/subscription/index.js +0 -19
- package/src/component/IMChatroom/util/account.js +0 -8
- package/src/component/IMChatroom/util/chatroom.js +0 -255
- package/src/component/IMChatroom/util/jsonBigInt.js +0 -5
- package/src/component/IMChatroom/util/location.js +0 -12
- package/src/component/Icon/index.jsx +0 -16
- package/src/component/Icon/index.module.less +0 -3
- package/src/component/Pagination/LocalPagination.jsx +0 -27
- package/src/component/Pagination/RemotePagination.jsx +0 -32
- package/src/component/Pagination/index.jsx +0 -32
- package/src/component/Pagination/index.module.less +0 -117
- package/src/component/PlayerTip/index.jsx +0 -34
- package/src/component/VideoBase/index.jsx +0 -242
- package/src/component/VideoBase/style.less +0 -66
- package/src/component/VideoBase/utils.js +0 -81
- package/src/component/mixin.less +0 -10
- package/src/component/status/403.jsx +0 -15
- package/src/component/status/404/img/404.png +0 -0
- package/src/component/status/404/index.jsx +0 -73
- package/src/component/status/404/index.module.less +0 -36
- package/src/component/status/Error/error.module.less +0 -14
- package/src/component/status/Error/img/error.png +0 -0
- package/src/component/status/Error/index.jsx +0 -47
- package/src/component/status/Loading/img/loading.svg +0 -52
- package/src/component/status/Loading/index.jsx +0 -31
- package/src/component/status/Loading/index.less +0 -57
- package/src/component/status/None/img/404.png +0 -0
- package/src/component/status/None/index.jsx +0 -20
- package/src/component/status/None/index.module.less +0 -35
- package/src/component/status/Status/index.jsx +0 -26
- package/src/component/status/Status/index.module.less +0 -9
- package/src/config/constant/commonUrl.js +0 -2
- package/src/config/constant/user.js +0 -6
- package/src/config/context/site-config.js +0 -48
- package/src/config/env/index.js +0 -5
- package/src/config/env/local/index.js +0 -13
- package/src/config/env/ncet-xedu/api.js +0 -175
- package/src/config/env/ncet-xedu/app.js +0 -12
- package/src/config/env/ncet-xedu/cs.js +0 -8
- package/src/config/env/ncet-xedu/index.js +0 -14
- package/src/config/env/ncet-xedu/push.js +0 -5
- package/src/config/env/preproduction/api.js +0 -144
- package/src/config/env/preproduction/app.js +0 -12
- package/src/config/env/preproduction/cs.js +0 -8
- package/src/config/env/preproduction/index.js +0 -14
- package/src/config/env/preproduction/push.js +0 -5
- package/src/config/env/product/api.js +0 -113
- package/src/config/env/product/app.js +0 -12
- package/src/config/env/product/cs.js +0 -5
- package/src/config/env/product/index.js +0 -14
- package/src/config/env/product/push.js +0 -5
- package/src/config/live.js +0 -80
- package/src/config/publicLive.js +0 -53
- package/src/config/request/assessments.js +0 -24
- package/src/config/request/config-center.js +0 -8
- package/src/config/request/helper.js +0 -190
- package/src/config/request/im-broadcasts.js +0 -12
- package/src/config/request/live-activity-gateway.js +0 -8
- package/src/config/request/live-activity.js +0 -13
- package/src/config/request/raw.js +0 -6
- package/src/config/request/x-cloud-web.js +0 -13
- package/src/config/request/x-proxy.js +0 -34
- package/src/demo/Detail.jsx +0 -11
- package/src/demo/List.jsx +0 -68
- package/src/demo/index.jsx +0 -17
- package/src/detail/LineSwitch/index.jsx +0 -71
- package/src/detail/LineSwitch/index.module.less +0 -0
- package/src/detail/LiveCountDown/index.jsx +0 -44
- package/src/detail/LiveCountDown/index.module.less +0 -32
- package/src/detail/LiveOnlineCount/img/icon.svg +0 -16
- package/src/detail/LiveOnlineCount/index.jsx +0 -68
- package/src/detail/LiveOnlineCount/index.module.less +0 -34
- package/src/detail/LiveOnlineCount/util.js +0 -74
- package/src/detail/LiveStatus/AnchorOnTheWay.jsx +0 -88
- package/src/detail/LiveStatus/index.jsx +0 -202
- package/src/detail/LiveStatus/index.module.less +0 -193
- package/src/detail/LiveVideo/asset/play-button-hover-m.png +0 -0
- package/src/detail/LiveVideo/asset/play-button-hover.png +0 -0
- package/src/detail/LiveVideo/asset/play-button-m.png +0 -0
- package/src/detail/LiveVideo/asset/play-button.png +0 -0
- package/src/detail/LiveVideo/config.js +0 -37
- package/src/detail/LiveVideo/index.jsx +0 -188
- package/src/detail/LiveVideo/index.module.less +0 -41
- package/src/detail/NotLoginChatroom/asset/empty-m.png +0 -0
- package/src/detail/NotLoginChatroom/asset/empty.png +0 -0
- package/src/detail/NotLoginChatroom/index.jsx +0 -37
- package/src/detail/NotLoginChatroom/index.module.less +0 -46
- package/src/detail/RecordVideo/index.jsx +0 -150
- package/src/detail/RecordVideo/index.module.less +0 -32
- package/src/detail/ReplayVideo/index.jsx +0 -93
- package/src/detail/ReplayVideo/index.module.less +0 -65
- package/src/detail/const.js +0 -20
- package/src/detail/hook/usePullSource.js +0 -82
- package/src/detail/hook/usePullState.js +0 -51
- package/src/detail/img/icon_coffee.png +0 -0
- package/src/detail/img/icon_completed.png +0 -0
- package/src/detail/index.jsx +0 -483
- package/src/detail/index.module.less +0 -189
- package/src/hook/useAsync.js +0 -84
- package/src/hook/useGoToPage.js +0 -83
- package/src/hook/useInterval.js +0 -28
- package/src/hook/useIsMounted.js +0 -17
- package/src/hook/useModuleByRole.js +0 -53
- package/src/hook/usePageScrollable.js +0 -52
- package/src/hook/usePortal.js +0 -83
- package/src/hook/useScrollRestore/index.js +0 -32
- package/src/hook/useScrollRestore/scrollContext.js +0 -20
- package/src/hook/useTrackRef.js +0 -11
- package/src/hook/useWindowSize.js +0 -28
- package/src/hook/useZoom.js +0 -47
- package/src/index.js +0 -10
- package/src/lib/getLiveOnlineCount.js +0 -10
- package/src/lib/getServiceConfig.js +0 -102
- package/src/list/Empty/img/empty.png +0 -0
- package/src/list/Empty/index.jsx +0 -20
- package/src/list/Empty/index.module.less +0 -23
- package/src/list/ListItem/Action/index.jsx +0 -109
- package/src/list/ListItem/Action/index.module.less +0 -26
- package/src/list/ListItem/img/dianzan.svg +0 -4
- package/src/list/ListItem/img/like-fill.svg +0 -8
- package/src/list/ListItem/img/live.png +0 -0
- package/src/list/ListItem/img/play.svg +0 -16
- package/src/list/ListItem/img/video.svg +0 -3
- package/src/list/ListItem/img/view-fill.svg +0 -8
- package/src/list/ListItem/img/yiguankan.svg +0 -3
- package/src/list/ListItem/index.jsx +0 -135
- package/src/list/ListItem/index.module.less +0 -158
- package/src/list/index.jsx +0 -241
- package/src/list/index.module.less +0 -39
- package/src/service/common.js +0 -73
- package/src/service/content-mgr.js +0 -73
- package/src/service/im-group.js +0 -12
- package/src/service/im.js +0 -7
- package/src/service/imBroadcasts.js +0 -33
- package/src/service/like.js +0 -134
- package/src/service/live.js +0 -293
- package/src/service/manageApi.js +0 -7
- package/src/service/managePortal.js +0 -6
- package/src/service/myStudyRecord.js +0 -93
- package/src/service/navigation.js +0 -47
- package/src/service/ndMeeting.js +0 -10
- package/src/service/ndr.js +0 -122
- package/src/service/news.js +0 -93
- package/src/service/personalCenter.js +0 -270
- package/src/service/qualityCourse.js +0 -31
- package/src/service/recommend.js +0 -81
- package/src/service/school.js +0 -323
- package/src/service/search.js +0 -170
- package/src/service/site-config.js +0 -7
- package/src/service/socialCensor.js +0 -45
- package/src/service/specialEdu.js +0 -31
- package/src/service/suggestion.js +0 -85
- package/src/service/syncClassroom.js +0 -321
- package/src/service/tCourse.js +0 -204
- package/src/service/tchTraining.js +0 -37
- package/src/service/uc.js +0 -45
- package/src/util/app.js +0 -1
- package/src/util/array.js +0 -3
- package/src/util/auth/func.js +0 -57
- package/src/util/date.js +0 -53
- package/src/util/env.js +0 -9
- package/src/util/getTimestamp.js +0 -10
- package/src/util/hof.js +0 -105
- package/src/util/live/index.js +0 -42
- package/src/util/liveCountUtil.js +0 -52
- package/src/util/netUrl.js +0 -35
- package/src/util/object.js +0 -13
- package/src/util/push/index.js +0 -58
- package/src/util/request.js +0 -227
- package/src/util/type.js +0 -17
- package/src/util/url.js +0 -203
- package/src/util/video.js +0 -26
- package/test/setup.js +0 -21
- package/test/unit/component/header/logo.spec.jsx +0 -8
- package/test/unit/helper.jsx +0 -25
- package/test/unit/util/date.spec.js +0 -40
|
@@ -1,270 +0,0 @@
|
|
|
1
|
-
import dayjs from 'dayjs'
|
|
2
|
-
// import SHA256 from 'crypto-js/sha256'
|
|
3
|
-
import { communityWithUC } from '@/config/request/community'
|
|
4
|
-
import { assessmentApi, assessmentApiCdn } from '@/config/request/assessments'
|
|
5
|
-
import { getLoginUrl, getUserInfo, goToLoginPage } from '@/util/auth/func'
|
|
6
|
-
import { assessmentRateCacheKey } from '@/config/constant/cacheKey'
|
|
7
|
-
import { tchStudioGatewayWithUC } from '@/config/request/teacher-studio-gateway'
|
|
8
|
-
|
|
9
|
-
import config from '@/config/env'
|
|
10
|
-
import { ApiTimestampKey } from '@/config/constant/common'
|
|
11
|
-
import { withOnce } from '@/util/hof'
|
|
12
|
-
|
|
13
|
-
const { appid } = config.app
|
|
14
|
-
|
|
15
|
-
function updateTimestamp(key = ApiTimestampKey.LAST_FAVOR_ACTION_TIMESTAMP) {
|
|
16
|
-
window.localStorage.setItem(key, new Date().getTime())
|
|
17
|
-
}
|
|
18
|
-
function getTimestamp(key = ApiTimestampKey.LAST_FAVOR_ACTION_TIMESTAMP) {
|
|
19
|
-
let time = window.localStorage.getItem(key)
|
|
20
|
-
if (!time) {
|
|
21
|
-
time = new Date().getTime()
|
|
22
|
-
window.localStorage.setItem(key, new Date().getTime())
|
|
23
|
-
}
|
|
24
|
-
return time
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export async function getTeacherStudios(params) {
|
|
28
|
-
const url = '/v1/users/teacher_studios'
|
|
29
|
-
try {
|
|
30
|
-
const result = await tchStudioGatewayWithUC.get(url, {
|
|
31
|
-
params: {
|
|
32
|
-
$offset: params.page_no * params.page_size,
|
|
33
|
-
$limit: params.page_size,
|
|
34
|
-
$count: true,
|
|
35
|
-
_userId: params.userId,
|
|
36
|
-
_t: getTimestamp(ApiTimestampKey.LAST_TEACHERSTUDIO_ACTION_TIMESTAMP)
|
|
37
|
-
}
|
|
38
|
-
})
|
|
39
|
-
return result
|
|
40
|
-
} catch (e) {
|
|
41
|
-
updateTimestamp(ApiTimestampKey.LAST_TEACHERSTUDIO_ACTION_TIMESTAMP)
|
|
42
|
-
throw e
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
export async function getMyCourses(params) {
|
|
47
|
-
const url = '/user_study'
|
|
48
|
-
try {
|
|
49
|
-
const result = await communityWithUC.get(url, {
|
|
50
|
-
params: {
|
|
51
|
-
offset: params.page_no * params.page_size,
|
|
52
|
-
limit: params.page_size,
|
|
53
|
-
_userId: params.userId,
|
|
54
|
-
_t: getTimestamp(ApiTimestampKey.LAST_STUDY_ACTION_TIMESTAMP)
|
|
55
|
-
},
|
|
56
|
-
headers: {
|
|
57
|
-
'sdp-app-id': appid
|
|
58
|
-
}
|
|
59
|
-
})
|
|
60
|
-
return result
|
|
61
|
-
} catch (e) {
|
|
62
|
-
updateTimestamp(ApiTimestampKey.LAST_STUDY_ACTION_TIMESTAMP)
|
|
63
|
-
throw e
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
/** 获取用户课程评价信息
|
|
68
|
-
* @param assessmentId: 评价对象(课程id)
|
|
69
|
-
* @param assessmentType: 评价对象资源类型(默认course,前后端暂时都没有用这个字段,建议传递资源类型字段x_course(课本),x_class_hour_activity(课程也就是课时),t_course(教师研修),t_course_pdf(教师研修下的Pdf资源),x_audio_video,x_url,x_image_list,x_document,x_article
|
|
70
|
-
* @return userAssessmentVo: {
|
|
71
|
-
"assessment_id": "string",
|
|
72
|
-
"assessment_type": "string",
|
|
73
|
-
"user_id": 0,
|
|
74
|
-
"score": 0
|
|
75
|
-
}
|
|
76
|
-
*/
|
|
77
|
-
export async function getUserAssessmentRate(assessmentId, assessmentType = 'course') {
|
|
78
|
-
const userInfo = await getUserInfo()
|
|
79
|
-
const cacheKey = assessmentRateCacheKey(assessmentId, userInfo.user_id)
|
|
80
|
-
let userAssessmentVo = localStorage.getItem(cacheKey)
|
|
81
|
-
if (userAssessmentVo) {
|
|
82
|
-
try {
|
|
83
|
-
userAssessmentVo = JSON.parse(userAssessmentVo)
|
|
84
|
-
} catch (e) {
|
|
85
|
-
// parse error
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
if (!userAssessmentVo || !userAssessmentVo.assessment_id) {
|
|
89
|
-
const url = `/assessments/${assessmentId}/user_assessment?assessment_type=${assessmentType}`
|
|
90
|
-
const { data } = await assessmentApi.get(url, {
|
|
91
|
-
headers: {
|
|
92
|
-
'sdp-app-id': appid
|
|
93
|
-
}
|
|
94
|
-
})
|
|
95
|
-
if (data?.score ?? '') {
|
|
96
|
-
userAssessmentVo = data
|
|
97
|
-
}
|
|
98
|
-
if (userAssessmentVo) {
|
|
99
|
-
localStorage.setItem(cacheKey, JSON.stringify(userAssessmentVo))
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
return userAssessmentVo
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
/** 获取课程评价
|
|
106
|
-
* @param assessmentId: 评价对象(课程id)
|
|
107
|
-
* @param assessment_type: 评价对象资源类型(默认course,前后端暂时都没有用这个字段,建议传递资源类型字段x_course(课本),x_class_hour_activity(课程也就是课时),t_course(教师研修),t_course_pdf(教师研修下的Pdf资源),x_audio_video,x_url,x_image_list,x_document,x_article
|
|
108
|
-
* @return assessmentVo: {
|
|
109
|
-
"assessment_id": "string",
|
|
110
|
-
"assessment_type": "string",
|
|
111
|
-
"total_user_count": "number",
|
|
112
|
-
"score": 0,
|
|
113
|
-
"star_1_rate": 0,
|
|
114
|
-
"star_2_rate": 0,
|
|
115
|
-
"star_3_rate": 0,
|
|
116
|
-
"star_4_rate": 0,
|
|
117
|
-
"star_5_rate": 0,
|
|
118
|
-
"details": [
|
|
119
|
-
{
|
|
120
|
-
"user_count": 0,
|
|
121
|
-
"score": 0
|
|
122
|
-
}
|
|
123
|
-
]
|
|
124
|
-
}
|
|
125
|
-
*/
|
|
126
|
-
const getUserInfoOnce = withOnce(getUserInfo)
|
|
127
|
-
|
|
128
|
-
export async function getAssessmentRate(
|
|
129
|
-
assessmentId,
|
|
130
|
-
assessmentType = 'course'
|
|
131
|
-
) {
|
|
132
|
-
const userInfo = await getUserInfoOnce()
|
|
133
|
-
let userAssessmentVo
|
|
134
|
-
if (userInfo) {
|
|
135
|
-
const cacheKey = assessmentRateCacheKey(assessmentId, userInfo.user_id)
|
|
136
|
-
try {
|
|
137
|
-
userAssessmentVo = JSON.parse(localStorage.getItem(cacheKey))
|
|
138
|
-
} catch (e) {
|
|
139
|
-
//
|
|
140
|
-
}
|
|
141
|
-
if (userAssessmentVo && !userAssessmentVo.assessment_id && userAssessmentVo.score) {
|
|
142
|
-
submitUserAssessmentRate(assessmentId, userAssessmentVo.score, assessmentType)
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
let lastModified
|
|
146
|
-
let assessmentVo
|
|
147
|
-
try {
|
|
148
|
-
const { data, headers: { 'last-modified': _lastModified } } = await assessmentApiCdn.get(`/assessments/${assessmentId}?assessment_type=${assessmentType}`)
|
|
149
|
-
assessmentVo = data
|
|
150
|
-
lastModified = dayjs(_lastModified).valueOf()
|
|
151
|
-
} catch (e) {
|
|
152
|
-
//
|
|
153
|
-
}
|
|
154
|
-
if (!assessmentVo?.details?.length) {
|
|
155
|
-
assessmentVo = {
|
|
156
|
-
assessment_id: assessmentId,
|
|
157
|
-
assessment_type: assessmentType,
|
|
158
|
-
details: [{
|
|
159
|
-
user_count: 0,
|
|
160
|
-
score: 1
|
|
161
|
-
}, {
|
|
162
|
-
user_count: 0,
|
|
163
|
-
score: 2
|
|
164
|
-
}, {
|
|
165
|
-
user_count: 0,
|
|
166
|
-
score: 3
|
|
167
|
-
}, {
|
|
168
|
-
user_count: 0,
|
|
169
|
-
score: 4
|
|
170
|
-
}, {
|
|
171
|
-
user_count: 0,
|
|
172
|
-
score: 5
|
|
173
|
-
}]
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
if (userAssessmentVo?.updateTime > lastModified) {
|
|
177
|
-
assessmentVo.details.forEach((detail) => {
|
|
178
|
-
if (detail.score === userAssessmentVo.score) {
|
|
179
|
-
detail.user_count += 1
|
|
180
|
-
}
|
|
181
|
-
})
|
|
182
|
-
}
|
|
183
|
-
assessmentVo.total_user_count = assessmentVo.details?.reduce((prev, next) => prev + next.user_count, 0)
|
|
184
|
-
if (assessmentVo.total_user_count) {
|
|
185
|
-
let lessThan1Count = 0
|
|
186
|
-
let scoreOver1P = 0
|
|
187
|
-
const totalScore = assessmentVo.details.reduce((prev, next) => prev + next.user_count * next.score, 0)
|
|
188
|
-
assessmentVo.score = (totalScore / assessmentVo.total_user_count).toFixed(1)
|
|
189
|
-
assessmentVo.details.forEach((detail) => {
|
|
190
|
-
const rate = Math.round((detail.user_count * 100) / assessmentVo.total_user_count)
|
|
191
|
-
assessmentVo[`star_${detail.score}_rate`] = rate
|
|
192
|
-
if (rate) {
|
|
193
|
-
scoreOver1P += (rate * assessmentVo.total_user_count * detail.score) / 100
|
|
194
|
-
} else {
|
|
195
|
-
lessThan1Count += detail.user_count
|
|
196
|
-
}
|
|
197
|
-
})
|
|
198
|
-
let restRate = 100
|
|
199
|
-
for (const key of Object.keys(assessmentVo)) {
|
|
200
|
-
if (/^star_(\d)_rate$/.test(key)) {
|
|
201
|
-
restRate -= assessmentVo[key]
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
if (restRate * assessmentVo.total_user_count > 100) {
|
|
205
|
-
let avarageScore
|
|
206
|
-
if (lessThan1Count) {
|
|
207
|
-
avarageScore = Math.round(Math.abs((totalScore - scoreOver1P)) / lessThan1Count / restRate)
|
|
208
|
-
} else if (restRate) {
|
|
209
|
-
avarageScore = Math.round(Math.abs(totalScore - scoreOver1P) / ((assessmentVo.total_user_count * restRate) / 100))
|
|
210
|
-
}
|
|
211
|
-
if (avarageScore) {
|
|
212
|
-
// eslint-disable-next-line no-nested-ternary
|
|
213
|
-
avarageScore = avarageScore > 5 ? 5 : avarageScore < 1 ? 1 : avarageScore
|
|
214
|
-
assessmentVo[`star_${avarageScore}_rate`] += restRate
|
|
215
|
-
}
|
|
216
|
-
} else {
|
|
217
|
-
let score = 5
|
|
218
|
-
while (score) {
|
|
219
|
-
if (assessmentVo[`star_${score}_rate`]) {
|
|
220
|
-
assessmentVo[`star_${score}_rate`] += restRate
|
|
221
|
-
break
|
|
222
|
-
}
|
|
223
|
-
score -= 1
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
if (assessmentVo.total_user_count > 100000) {
|
|
228
|
-
assessmentVo.total_user_count = '10w+'
|
|
229
|
-
} else if (assessmentVo.total_user_count > 10000) {
|
|
230
|
-
assessmentVo.total_user_count = `${(assessmentVo.total_user_count / 10000).toFixed(1)}w`
|
|
231
|
-
}
|
|
232
|
-
return assessmentVo
|
|
233
|
-
}
|
|
234
|
-
|
|
235
|
-
/** 提交用户评价
|
|
236
|
-
* @param assessmentId: 评价对象(课程id)
|
|
237
|
-
* @param score: 评分
|
|
238
|
-
* @param assessment_type: 评价对象资源类型(默认course,前后端暂时都没有用这个字段,建议传递资源类型字段x_course(课本),x_class_hour_activity(课程也就是课时),t_course(教师研修),t_course_pdf(教师研修下的Pdf资源),x_audio_video,x_url,x_image_list,x_document,x_article
|
|
239
|
-
*/
|
|
240
|
-
export async function submitUserAssessmentRate(assessmentId, score, assessment_type = 'course') {
|
|
241
|
-
const userInfo = await getUserInfo()
|
|
242
|
-
if (!userInfo) {
|
|
243
|
-
const loginUrl = getLoginUrl()
|
|
244
|
-
await goToLoginPage(loginUrl)
|
|
245
|
-
return
|
|
246
|
-
}
|
|
247
|
-
const cacheKey = assessmentRateCacheKey(assessmentId, userInfo.user_id)
|
|
248
|
-
const url = `/assessments/${assessmentId}/user_assessments`
|
|
249
|
-
let userAssessmentVo
|
|
250
|
-
try {
|
|
251
|
-
const { data } = await assessmentApi.post(url, {
|
|
252
|
-
assessment_type,
|
|
253
|
-
score
|
|
254
|
-
}, {
|
|
255
|
-
headers: {
|
|
256
|
-
'sdp-app-id': appid
|
|
257
|
-
}
|
|
258
|
-
})
|
|
259
|
-
userAssessmentVo = data
|
|
260
|
-
} catch (e) {
|
|
261
|
-
userAssessmentVo = {
|
|
262
|
-
assessment_type,
|
|
263
|
-
user_id: userInfo.user_id,
|
|
264
|
-
score
|
|
265
|
-
}
|
|
266
|
-
}
|
|
267
|
-
userAssessmentVo.updateTime = Date.now()
|
|
268
|
-
localStorage.setItem(cacheKey, JSON.stringify(userAssessmentVo))
|
|
269
|
-
return userAssessmentVo
|
|
270
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
getCdnAPI
|
|
3
|
-
} from '@/config/request/cdn'
|
|
4
|
-
import config from '@/config/env'
|
|
5
|
-
import { getNDRTestQuery } from '@/util/url'
|
|
6
|
-
|
|
7
|
-
const xCloudServiceName = config.api.serviceName['x-course']
|
|
8
|
-
|
|
9
|
-
const cdnAPI = getCdnAPI()
|
|
10
|
-
|
|
11
|
-
const isTest = getNDRTestQuery()
|
|
12
|
-
/**
|
|
13
|
-
* 获取精品课详情
|
|
14
|
-
* https://pretest-s-file-2.ykt.cbern.com.cn/zxx/ndrs/resources/8ae7e495-7cde-81e8-017c-e4c7bf0f01ca.json
|
|
15
|
-
* @param {*} contentId 课程id
|
|
16
|
-
*/
|
|
17
|
-
export async function fetchQualityCourse(courseId) {
|
|
18
|
-
const requestURL = isTest
|
|
19
|
-
? `https://bdcs-file-2.ykt.cbern.com.cn/zxx_secondary/ndrv2/resources/${courseId}.json`
|
|
20
|
-
: `/${xCloudServiceName}/ndrv2/resources/${courseId}.json`
|
|
21
|
-
const { data } = await cdnAPI.get(requestURL)
|
|
22
|
-
return data
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export async function fetchNationalCourse(courseId) {
|
|
26
|
-
const requestURL = isTest
|
|
27
|
-
? `https://bdcs-file-2.ykt.cbern.com.cn/zxx_secondary/ndrs/resources/${courseId}/relation/national_lesson.json`
|
|
28
|
-
: `/${xCloudServiceName}/ndrs/resources/${courseId}/relation/national_lesson.json`
|
|
29
|
-
const { data } = await cdnAPI.get(requestURL)
|
|
30
|
-
return data
|
|
31
|
-
}
|
package/src/service/recommend.js
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
/* eslint-disable max-len */
|
|
2
|
-
import shuffle from 'lodash/shuffle'
|
|
3
|
-
import api from '@/config/request/recommend'
|
|
4
|
-
import sha256 from '@/util/sha256'
|
|
5
|
-
import cdnAPI from '@/config/request/cdn'
|
|
6
|
-
import rawAPI from '@/config/request/raw'
|
|
7
|
-
|
|
8
|
-
import config from '@/config/env'
|
|
9
|
-
|
|
10
|
-
const { recommend, app } = config
|
|
11
|
-
|
|
12
|
-
const { channelId, JPKChannelId } = recommend
|
|
13
|
-
|
|
14
|
-
const { appid } = app
|
|
15
|
-
|
|
16
|
-
const libraryServiceName = config.api.serviceName.library
|
|
17
|
-
|
|
18
|
-
// http://api.e.101.com/services/elearning-channel-gateway/description/rest/html?env=design&version=10.8.3-SNAPSHOT#/v2/channels/{channel_id}/sections
|
|
19
|
-
async function getHashPath(id) {
|
|
20
|
-
const urlPath = `/v2/channels/${id}/sections`
|
|
21
|
-
const hashCode = await sha256(`${urlPath}?query_type=0`)
|
|
22
|
-
return `${urlPath}/${hashCode}.json`
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
async function getRequestURL(hashPath) {
|
|
26
|
-
const component = 'auxo_channel_api'
|
|
27
|
-
return `/${libraryServiceName}/api/zh-CN/${appid}/${component}${hashPath}`
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* 获取推荐页频道数据
|
|
32
|
-
*/
|
|
33
|
-
export async function getRecommendChannelData() {
|
|
34
|
-
// 由于预生产的 cdn 都切到了 pretest 这里做下特殊处理 走预生产
|
|
35
|
-
if (process.env.SDP_ENV === 'preproduction') {
|
|
36
|
-
const hashPath = await getHashPath('b77b95c0-917a-4f52-b7ce-9d2c79a47894')
|
|
37
|
-
const requestURL = await getRequestURL(hashPath)
|
|
38
|
-
const { data } = await rawAPI.get(`https://ndcs-pre.101.com/${requestURL}`)
|
|
39
|
-
return data
|
|
40
|
-
} else {
|
|
41
|
-
const hashPath = await getHashPath(channelId)
|
|
42
|
-
const requestURL = await getRequestURL(hashPath)
|
|
43
|
-
const { data } = await cdnAPI.get(requestURL)
|
|
44
|
-
return data
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* 获取推荐精品课堂数据
|
|
50
|
-
*/
|
|
51
|
-
export async function getRecommendJPKData() {
|
|
52
|
-
const hashPath = await getHashPath(JPKChannelId)
|
|
53
|
-
const requestURL = await getRequestURL(hashPath)
|
|
54
|
-
const { data } = await cdnAPI.get(requestURL)
|
|
55
|
-
return data
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* 推荐服务
|
|
60
|
-
* http://api.e.101.com/services/x-recommend-service/description/rest/html?env=design&version=1.0.0-SNAPSHOT#/v1/user/resource/recommend@get
|
|
61
|
-
*/
|
|
62
|
-
|
|
63
|
-
// 用户同步学习进度的课时活动推荐
|
|
64
|
-
export async function getCourseRecommend() {
|
|
65
|
-
const { data } = await api.get('/user/sync_course/activity/recommend')
|
|
66
|
-
return data
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
export async function getResourceRecommend({
|
|
70
|
-
userRole
|
|
71
|
-
}) {
|
|
72
|
-
const { data } = await api.get('/user/resource/recommend', {
|
|
73
|
-
params: {
|
|
74
|
-
identity_code: userRole || 'GUEST'
|
|
75
|
-
}
|
|
76
|
-
})
|
|
77
|
-
// data.resources = shuffle([...data.resources, ...data.resources])
|
|
78
|
-
data.studios = shuffle(data.studios)
|
|
79
|
-
data.resources = shuffle(data.resources)
|
|
80
|
-
return data
|
|
81
|
-
}
|
package/src/service/school.js
DELETED
|
@@ -1,323 +0,0 @@
|
|
|
1
|
-
import { memoize } from 'lodash'
|
|
2
|
-
import config from '@/config/env'
|
|
3
|
-
import { getCdnAPI, getCdnHotAPI } from '@/config/request/cdn'
|
|
4
|
-
import cdnAPISchool, { apiCommon } from '@/config/request/x-cloud-web'
|
|
5
|
-
// import eduAdminPublicBase from '@/config/request/edu-admin-public-base'
|
|
6
|
-
import rawAPI from '@/config/request/raw'
|
|
7
|
-
|
|
8
|
-
const schoolServiceName = config.api.serviceName.school
|
|
9
|
-
const areaServiceName = config.api.serviceName.areaLibrary
|
|
10
|
-
|
|
11
|
-
const other = {
|
|
12
|
-
area: 'bdxcloud/configs/rank_area_info.json',
|
|
13
|
-
school: 'v1/area_infos/{area_code}/school_infos',
|
|
14
|
-
schoolDetail: 'v1/school_infos/{school_id}/actions/detail',
|
|
15
|
-
gradeSection: 'bdxcloud/configs/gradeSection.json',
|
|
16
|
-
subjectCode: 'bdxcloud/configs/subjectCode.json',
|
|
17
|
-
jobTitle: 'bdxcloud/configs/job_title.json',
|
|
18
|
-
schoolSection: 'studio/school/section.json',
|
|
19
|
-
teacherHonor: 'bdxcloud/configs/teacher_honor.json',
|
|
20
|
-
searchSchool: 'v1/school_infos/from_es?grade_section_contain=true&offset={offset}&limit={limit}&school_name={school_name}&area_code={area_code}'
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function isSchoolUrl(url) {
|
|
24
|
-
return url.indexOf('/school_infos') > -1
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
function isSchoolCommonUrl(url) {
|
|
28
|
-
return url.indexOf('v1/school_infos') > -1
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function isOtherUrl(url) {
|
|
32
|
-
return url.indexOf('bdxcloud/configs') > -1 || url.indexOf('studio/school/') > -1
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
function getServiceName(url) {
|
|
36
|
-
if (isSchoolUrl(url)) return schoolServiceName
|
|
37
|
-
if (isOtherUrl(url)) return ''
|
|
38
|
-
return areaServiceName
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
function getApiRequest(url) {
|
|
42
|
-
if (isSchoolCommonUrl(url)) return apiCommon
|
|
43
|
-
if (isSchoolUrl(url)) return cdnAPISchool
|
|
44
|
-
if (isOtherUrl(url)) return getCdnHotAPI()
|
|
45
|
-
return getCdnAPI()
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* 拼接请求信息
|
|
50
|
-
* @param {*} url
|
|
51
|
-
* @param {*} language
|
|
52
|
-
*/
|
|
53
|
-
async function getRequestURL(url) {
|
|
54
|
-
const serviceName = getServiceName(url)
|
|
55
|
-
return serviceName ? `/${serviceName}/${url}` : `/${url}`
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* 请求数据
|
|
60
|
-
* @param {*} url
|
|
61
|
-
* @returns
|
|
62
|
-
*/
|
|
63
|
-
async function getLibraryDatas(url) {
|
|
64
|
-
const requestURL = await getRequestURL(url)
|
|
65
|
-
const { data } = await getApiRequest(url).get(requestURL)
|
|
66
|
-
return data
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* 获取地区数据
|
|
71
|
-
* @param {*} id
|
|
72
|
-
* @returns
|
|
73
|
-
*/
|
|
74
|
-
export const getAreas = memoize(
|
|
75
|
-
async () => {
|
|
76
|
-
if (process.env.SDP_ENV === 'preproduction') {
|
|
77
|
-
const resp = await rawAPI.get('https://betacs.101.com/v0.1/static/preproduction_content_x_cloud/configs/rank_area_info.json')
|
|
78
|
-
return resp.data
|
|
79
|
-
} else {
|
|
80
|
-
const data = await getLibraryDatas(other.area)
|
|
81
|
-
return data
|
|
82
|
-
}
|
|
83
|
-
},
|
|
84
|
-
() => 'areas'
|
|
85
|
-
)
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* 获取地区下学校数据
|
|
89
|
-
* @param {*} areaCode
|
|
90
|
-
* @returns
|
|
91
|
-
*/
|
|
92
|
-
// export async function getSchools(areaCode) {
|
|
93
|
-
// const data = await getLibraryDatas(other.school.replace('{area_code}', areaCode))
|
|
94
|
-
// return data
|
|
95
|
-
// }
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* 新接口 获取地区下学校数据
|
|
99
|
-
* @param {*} areaCode
|
|
100
|
-
* @returns
|
|
101
|
-
*/
|
|
102
|
-
export async function getSchoolSearchApi({
|
|
103
|
-
areaCode,
|
|
104
|
-
isAll = false, // 是否搜索全部, 就是包括所有子集
|
|
105
|
-
schoolName = '',
|
|
106
|
-
offset = 0,
|
|
107
|
-
limit = 100
|
|
108
|
-
}) {
|
|
109
|
-
const params = {
|
|
110
|
-
include_sub_area: isAll,
|
|
111
|
-
offset,
|
|
112
|
-
limit,
|
|
113
|
-
count: true
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
if (areaCode) {
|
|
117
|
-
params.area_code = areaCode
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
if (schoolName) {
|
|
121
|
-
params.school_name = schoolName
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
const { data } = await apiCommon.get('/v1/school_infos/actions/search', {
|
|
125
|
-
params
|
|
126
|
-
})
|
|
127
|
-
return data
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* 获取学校年段
|
|
132
|
-
* @param {*} id
|
|
133
|
-
* @returns
|
|
134
|
-
*/
|
|
135
|
-
export async function getSchoolSectionApi(schoolInfo) {
|
|
136
|
-
const newSchoolInfo = {
|
|
137
|
-
...schoolInfo
|
|
138
|
-
}
|
|
139
|
-
const vals = await getTermMap()
|
|
140
|
-
newSchoolInfo.school_section = newSchoolInfo.school_section.map((section) => Object.keys(vals.find((v) => v.id === section)?.section))
|
|
141
|
-
newSchoolInfo.school_section = newSchoolInfo.school_section.join(',').split(',')
|
|
142
|
-
return newSchoolInfo
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* 获取学校数据
|
|
147
|
-
* @param {*} id
|
|
148
|
-
* @returns
|
|
149
|
-
*/
|
|
150
|
-
export async function getSchool(id) {
|
|
151
|
-
const data = await getLibraryDatas(other.schoolDetail.replace('{school_id}', id))
|
|
152
|
-
const vals = await getTermMap()
|
|
153
|
-
data.school_section = data.school_section.map((section) => Object.keys(vals.find((v) => v.id === section)?.section))
|
|
154
|
-
data.school_section = data.school_section.join(',').split(',')
|
|
155
|
-
return data
|
|
156
|
-
}
|
|
157
|
-
// 获取学校详情
|
|
158
|
-
export const getSchoolDetail = memoize(
|
|
159
|
-
async (id) => {
|
|
160
|
-
const data = await getLibraryDatas(other.schoolDetail.replace('{school_id}', id))
|
|
161
|
-
return data
|
|
162
|
-
},
|
|
163
|
-
(id) => `getSchoolDetail_${id}`
|
|
164
|
-
)
|
|
165
|
-
|
|
166
|
-
/**
|
|
167
|
-
* 获取学校数据
|
|
168
|
-
* @param {*} id
|
|
169
|
-
* @returns
|
|
170
|
-
*/
|
|
171
|
-
export async function getSchoolsByName(name, areaCode, offset = 0, limit = 10) {
|
|
172
|
-
let url = ''
|
|
173
|
-
if (!name && areaCode) {
|
|
174
|
-
url = other.searchSchool
|
|
175
|
-
.replace('&school_name={school_name}', '')
|
|
176
|
-
.replace('{area_code}', areaCode)
|
|
177
|
-
.replace('{offset}', offset)
|
|
178
|
-
.replace('{limit}', limit)
|
|
179
|
-
} else if (name && !areaCode) {
|
|
180
|
-
url = other.searchSchool
|
|
181
|
-
.replace('{school_name}', name)
|
|
182
|
-
.replace('&area_code={area_code}', '')
|
|
183
|
-
.replace('{offset}', offset)
|
|
184
|
-
.replace('{limit}', limit)
|
|
185
|
-
} else if (!name && !areaCode) {
|
|
186
|
-
url = other.searchSchool
|
|
187
|
-
.replace('{school_name}', name)
|
|
188
|
-
.replace('&area_code={area_code}', '')
|
|
189
|
-
.replace('{offset}', offset)
|
|
190
|
-
.replace('{limit}', limit)
|
|
191
|
-
} else {
|
|
192
|
-
url = other.searchSchool
|
|
193
|
-
.replace('{school_name}', name)
|
|
194
|
-
.replace('{area_code}', areaCode)
|
|
195
|
-
.replace('{offset}', offset)
|
|
196
|
-
.replace('{limit}', limit)
|
|
197
|
-
}
|
|
198
|
-
const data = await getLibraryDatas(url)
|
|
199
|
-
const vals = await getTermMap()
|
|
200
|
-
let items = data.items.map((item) => {
|
|
201
|
-
// 将编码转为机构
|
|
202
|
-
item.school_section = item.school_section.map((section) => Object.keys(vals.find((v) => v.id === section)?.section))
|
|
203
|
-
item.school_section = item.school_section.join(',').split(',')
|
|
204
|
-
// 将机构转为学段
|
|
205
|
-
return item
|
|
206
|
-
})
|
|
207
|
-
/**
|
|
208
|
-
* 把“其他”排到最后
|
|
209
|
-
*/
|
|
210
|
-
// 搜索了limit个
|
|
211
|
-
// 如果offset为0,说明是第一次搜索
|
|
212
|
-
if (offset === 0) {
|
|
213
|
-
window.tmpSchools = []
|
|
214
|
-
}
|
|
215
|
-
// 取其他学校数据
|
|
216
|
-
let newItems = items.filter((item) => item?.school_name?.indexOf('其他') === -1).sort((data1, data2) => data1?.school_name?.localeCompare(data2?.school_name, 'zh'))
|
|
217
|
-
const otherItems = items.filter((item) => item?.school_name?.indexOf('其他') > -1)
|
|
218
|
-
window.tmpSchools = [...window.tmpSchools, ...otherItems]
|
|
219
|
-
// 如果结果小于limit,说明搜索结束,添加其他地区
|
|
220
|
-
if (items?.length < limit) {
|
|
221
|
-
newItems = [...newItems, ...window.tmpSchools]
|
|
222
|
-
window.tmpSchools = []
|
|
223
|
-
}
|
|
224
|
-
items = [...newItems]
|
|
225
|
-
|
|
226
|
-
return {
|
|
227
|
-
...data,
|
|
228
|
-
items
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
export async function getSchoolByName(name) {
|
|
233
|
-
const schools = await getSchoolsByName(name)
|
|
234
|
-
return schools?.items?.find((s) => s.school_name === name)
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
/**
|
|
238
|
-
* 获取职称
|
|
239
|
-
* @returns
|
|
240
|
-
*/
|
|
241
|
-
export async function getJobTitles() {
|
|
242
|
-
const { data } = await rawAPI.get('https://bdcs-file-1.ykt.cbern.com.cn/bdxcloud/configs/job_title.json')
|
|
243
|
-
// const data = await getLibraryDatas(other.jobTitle)
|
|
244
|
-
return data
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
/**
|
|
248
|
-
* 获取学段
|
|
249
|
-
* @returns
|
|
250
|
-
*/
|
|
251
|
-
export async function getTerm() {
|
|
252
|
-
// const data = await getLibraryDatas(other.gradeSection)
|
|
253
|
-
const { data } = await rawAPI.get('https://bdcs-file-1.ykt.cbern.com.cn/bdxcloud/configs/gradeSection.json')
|
|
254
|
-
return data
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
export async function getTermMap() {
|
|
258
|
-
const { data } = await rawAPI.get('https://bdcs-file-1.ykt.cbern.com.cn/studio/school/section.json')
|
|
259
|
-
return data
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
// export function getDetailTerms(arg) {
|
|
263
|
-
// switch (arg) {
|
|
264
|
-
// case '小学':
|
|
265
|
-
// return [2]
|
|
266
|
-
// case '初中':
|
|
267
|
-
// return [3]
|
|
268
|
-
// case '高中':
|
|
269
|
-
// return [4]
|
|
270
|
-
// case '完中':
|
|
271
|
-
// return [3, 4]
|
|
272
|
-
// case '九年一贯制':
|
|
273
|
-
// return [2, 3]
|
|
274
|
-
// case '12年一贯制 ':
|
|
275
|
-
// return [2, 3]
|
|
276
|
-
// case '幼儿园':
|
|
277
|
-
// return [1]
|
|
278
|
-
// case '其他教育类':
|
|
279
|
-
// return [5]
|
|
280
|
-
// case '高等教育':
|
|
281
|
-
// case '中职':
|
|
282
|
-
// case '高职':
|
|
283
|
-
// case '机构':
|
|
284
|
-
// case '教学点':
|
|
285
|
-
// default:
|
|
286
|
-
// return [1, 2, 3, 4, 5]
|
|
287
|
-
// }
|
|
288
|
-
// }
|
|
289
|
-
|
|
290
|
-
/**
|
|
291
|
-
* 获取学科
|
|
292
|
-
* @returns
|
|
293
|
-
*/
|
|
294
|
-
export async function getTermSubject(key) {
|
|
295
|
-
const { data } = await rawAPI.get('https://bdcs-file-1.ykt.cbern.com.cn/bdxcloud/configs/subjectCode.json')
|
|
296
|
-
// const data = await getLibraryDatas(other.subjectCode)
|
|
297
|
-
const res = {}
|
|
298
|
-
Object.keys(data).forEach((val, idx) => {
|
|
299
|
-
if (String(val).slice(0, 1) === String(key)) {
|
|
300
|
-
res[val] = Object.values(data)[idx]
|
|
301
|
-
}
|
|
302
|
-
})
|
|
303
|
-
return res
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
/**
|
|
307
|
-
* 获取学校信息
|
|
308
|
-
* @param {*} id
|
|
309
|
-
* @returns
|
|
310
|
-
*/
|
|
311
|
-
export async function getSchoolInfo(id) {
|
|
312
|
-
const data = await getLibraryDatas(other.schoolDetail.replace('{school_id}', id))
|
|
313
|
-
return data
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
/**
|
|
317
|
-
* 获取荣誉
|
|
318
|
-
* @returns
|
|
319
|
-
*/
|
|
320
|
-
export async function getHonor() {
|
|
321
|
-
const data = await getLibraryDatas(other.teacherHonor)
|
|
322
|
-
return data
|
|
323
|
-
}
|