@x-edu/live-player 0.0.34 → 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 +1072 -11202
- package/dist/XEduLivePlayerPre.common.js +877 -11368
- package/package.json +6 -4
- 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 -22
- package/src/component/IMChatroom/sdk/imcore/constants.js +0 -130
- 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/ncet-xedu-beta/api.js +0 -175
- package/src/config/env/ncet-xedu-beta/app.js +0 -12
- package/src/config/env/ncet-xedu-beta/cs.js +0 -8
- package/src/config/env/ncet-xedu-beta/index.js +0 -14
- package/src/config/env/ncet-xedu-beta/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,178 +0,0 @@
|
|
|
1
|
-
import IMCoreChatroom from '@ndim/chatroom'
|
|
2
|
-
import { reverse } from 'lodash'
|
|
3
|
-
|
|
4
|
-
import getUCInstance from '../uc'
|
|
5
|
-
import { getCurrentAccount, getCurrentAccountId } from '../../util/account'
|
|
6
|
-
import appConfig from '../../config/app'
|
|
7
|
-
import bridge from '../bridge'
|
|
8
|
-
import * as C from '../../constants'
|
|
9
|
-
|
|
10
|
-
import loadPlugins from './plugins'
|
|
11
|
-
import { imCoreOrigin, imCoreApiOrigin, ContentType, MessageTypeMap } from './constants'
|
|
12
|
-
import requestInterceptors from './interceptors/request'
|
|
13
|
-
import responseInterceptors from './interceptors/response'
|
|
14
|
-
import emitters from './emitters'
|
|
15
|
-
import { transferStringToLong, transferLongToString, formatMessages } from './util/format'
|
|
16
|
-
import getUserInfoWithCache from '../oms'
|
|
17
|
-
|
|
18
|
-
// eslint-disable-next-line import/no-mutable-exports
|
|
19
|
-
let imCoreChatroom = null
|
|
20
|
-
|
|
21
|
-
// eslint-disable-next-line import/prefer-default-export
|
|
22
|
-
export const initIMCoreChatroom = () => new Promise((resolve, reject) => getUCInstance().getTokenAsync().then((token) => {
|
|
23
|
-
loadPlugins(token, getCurrentAccount())
|
|
24
|
-
|
|
25
|
-
imCoreChatroom = new IMCoreChatroom({
|
|
26
|
-
server: { // webSocket 配置
|
|
27
|
-
wsUrl: appConfig.get('wsUrl') || imCoreOrigin, // IMCore 服务端 webSocket 服务器响应地址,必填
|
|
28
|
-
wsProtocols: '', // webSocket 子协议
|
|
29
|
-
apiHost: imCoreApiOrigin, // IMCoreApi 服务地址,必填
|
|
30
|
-
cachePrefix: appConfig.get('business')
|
|
31
|
-
},
|
|
32
|
-
autoAck: true, // 是否自动 ack 消息(即:是否自动通知服务端已接收到的最大的收件箱消息id),默认 false,选填
|
|
33
|
-
listenConversationChange: false, // 是否监听会话变更,若监听,会话变更后将更新会话已读游标等,默认 true,选填
|
|
34
|
-
messageCompletion: { // 消息补齐配置,选填
|
|
35
|
-
enable: false, // 是否开启
|
|
36
|
-
interval: 500, // 补齐频率,默认 500,单位,毫秒
|
|
37
|
-
untilAgo: 1 // 补齐多少天的消息,默认 15,单位,天
|
|
38
|
-
}
|
|
39
|
-
})
|
|
40
|
-
|
|
41
|
-
console.log('imCoreChatroom', imCoreChatroom)
|
|
42
|
-
|
|
43
|
-
// 设置请求拦截器
|
|
44
|
-
imCoreChatroom.request.instance.interceptors.request.use(...requestInterceptors)
|
|
45
|
-
imCoreChatroom.request.instance.interceptors.response.use(...responseInterceptors)
|
|
46
|
-
|
|
47
|
-
// 注册emitter事件
|
|
48
|
-
Object.keys(emitters).forEach((emitterName) => {
|
|
49
|
-
imCoreChatroom.emitter.on(emitterName, emitters[emitterName].bind(imCoreChatroom))
|
|
50
|
-
})
|
|
51
|
-
|
|
52
|
-
// 连接登录聊天室
|
|
53
|
-
imCoreChatroom.connect(getCurrentAccountId())
|
|
54
|
-
|
|
55
|
-
resolve(imCoreChatroom)
|
|
56
|
-
}).catch((error) => {
|
|
57
|
-
reject(error)
|
|
58
|
-
}))
|
|
59
|
-
|
|
60
|
-
export const getIMCoreChatroom = () => imCoreChatroom
|
|
61
|
-
|
|
62
|
-
export const reconnectIMCoreChatroom = () => {
|
|
63
|
-
imCoreChatroom.connect(getCurrentAccountId())
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
const __sendMessage = (message, online) => {
|
|
67
|
-
if (!online) {
|
|
68
|
-
return Promise.resolve(formatMessages([{
|
|
69
|
-
...message,
|
|
70
|
-
from: getCurrentAccountId(),
|
|
71
|
-
content: message.buildContent()
|
|
72
|
-
}])[0])
|
|
73
|
-
}
|
|
74
|
-
return imCoreChatroom.sendMessage({
|
|
75
|
-
time: null,
|
|
76
|
-
seq: null,
|
|
77
|
-
qos: 0,
|
|
78
|
-
resendFlag: 0,
|
|
79
|
-
convtype: 3,
|
|
80
|
-
buildContent: message.buildContent.bind(message)
|
|
81
|
-
}).then((res) => {
|
|
82
|
-
const data = transferLongToString(res)
|
|
83
|
-
return {
|
|
84
|
-
id: data.msgId,
|
|
85
|
-
seq: data.msgSeq,
|
|
86
|
-
time: data.msgTime,
|
|
87
|
-
_direction: 'up',
|
|
88
|
-
_localInfo: {
|
|
89
|
-
id: data.msgId,
|
|
90
|
-
index: 0
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
})
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
const _sendMessage = async (contentType, contentBody, online, headers) => {
|
|
97
|
-
const messageType = MessageTypeMap[contentType]
|
|
98
|
-
const message = new IMCoreChatroom.MessageConstructor[messageType]()
|
|
99
|
-
if (headers) {
|
|
100
|
-
message.setHeaders(headers)
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
if (contentType === ContentType.Text && contentBody.length > 500) {
|
|
104
|
-
let result
|
|
105
|
-
for (let i = 0; i < contentBody.length; i += 500) {
|
|
106
|
-
const body = contentBody.substring(i, i + 500)
|
|
107
|
-
message.setBody(body)
|
|
108
|
-
result = await __sendMessage(message, online)
|
|
109
|
-
}
|
|
110
|
-
return result
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
let body = contentBody
|
|
114
|
-
if (messageType === ContentType.Image) {
|
|
115
|
-
body = body.replace('fullimage', 'fullImage')
|
|
116
|
-
}
|
|
117
|
-
message.setBody(body)
|
|
118
|
-
return __sendMessage(message, online)
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
export const sendMessage = async (contentType, contentBody, online) => {
|
|
122
|
-
if (appConfig.get('messageEditor.getMessageHeaders')) {
|
|
123
|
-
return bridge.register('getMessageHeaders').then((headers) => _sendMessage(contentType, contentBody, online, headers))
|
|
124
|
-
} else {
|
|
125
|
-
const userId = await getCurrentAccountId()
|
|
126
|
-
const userInfo = await getUserInfoWithCache(userId)
|
|
127
|
-
return _sendMessage(contentType, contentBody, online,
|
|
128
|
-
{
|
|
129
|
-
'Content-Sender': {
|
|
130
|
-
user_id: userId,
|
|
131
|
-
nick_name: userInfo.real_name
|
|
132
|
-
}
|
|
133
|
-
})
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
export const getHistoryMessages = (id, limit) => imCoreChatroom.getHistoryMessages(transferStringToLong(id), limit)
|
|
138
|
-
.then((messages) => {
|
|
139
|
-
const items = reverse(formatMessages(messages.map((message) => transferLongToString(message))))
|
|
140
|
-
|
|
141
|
-
// items.forEach((message) => {
|
|
142
|
-
// const messageType = get(message, '_parsedContent.type')
|
|
143
|
-
// if ([C.MESSAGE_TYPE.CTL, C.MESSAGE_TYPE.NTF, C.MESSAGE_TYPE.TEL].some((type) => messageType === type)) {
|
|
144
|
-
// thirdParty.onPostMessage(thirdParty.EVENT.CMD, message)
|
|
145
|
-
// }
|
|
146
|
-
// })
|
|
147
|
-
|
|
148
|
-
const hasMore = items.length > 0 && items[0].id !== C.MIM_CONV_MSG_ID
|
|
149
|
-
if (appConfig.get('chatroomChatMessageList.filterMessages')) {
|
|
150
|
-
return bridge.register('filterMessages', {
|
|
151
|
-
type: 'history',
|
|
152
|
-
messages: items,
|
|
153
|
-
hasMore
|
|
154
|
-
})
|
|
155
|
-
}
|
|
156
|
-
return {
|
|
157
|
-
messages: items,
|
|
158
|
-
hasMore
|
|
159
|
-
}
|
|
160
|
-
})
|
|
161
|
-
|
|
162
|
-
export const subscribeOnlineStatus = () => imCoreChatroom.subscribeOnlineStatus()
|
|
163
|
-
|
|
164
|
-
export const recallMessage = (message) => {
|
|
165
|
-
if (appConfig.get('chatroomChatMessageList.getRecallMessageExtInfo')) {
|
|
166
|
-
return bridge.register('getRecallMessageExtInfo', message).then(
|
|
167
|
-
(extInfo) => imCoreChatroom.recallMessage({
|
|
168
|
-
time: transferStringToLong(message.time),
|
|
169
|
-
id: transferStringToLong(message.id)
|
|
170
|
-
}, extInfo)
|
|
171
|
-
)
|
|
172
|
-
} else {
|
|
173
|
-
return imCoreChatroom.recallMessage({
|
|
174
|
-
time: transferStringToLong(message.time),
|
|
175
|
-
id: transferStringToLong(message.id)
|
|
176
|
-
})
|
|
177
|
-
}
|
|
178
|
-
}
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import IMCoreChatroom from '@ndim/chatroom'
|
|
2
|
-
import Sha from 'nd-sha'
|
|
3
|
-
|
|
4
|
-
import getUCInstance from '../../uc'
|
|
5
|
-
|
|
6
|
-
function getNonce(diff) {
|
|
7
|
-
function rnd(min, max) {
|
|
8
|
-
const arr = [
|
|
9
|
-
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9',
|
|
10
|
-
'a', 'b', 'c', 'd', 'e', 'f', 'g',
|
|
11
|
-
'h', 'i', 'j', 'k', 'l', 'm', 'n',
|
|
12
|
-
'o', 'p', 'q', 'r', 's', 't',
|
|
13
|
-
'u', 'v', 'w', 'x', 'y', 'z',
|
|
14
|
-
'A', 'B', 'C', 'D', 'E', 'F', 'G',
|
|
15
|
-
'H', 'I', 'J', 'K', 'L', 'M', 'N',
|
|
16
|
-
'O', 'P', 'Q', 'R', 'S', 'T',
|
|
17
|
-
'U', 'V', 'W', 'X', 'Y', 'Z'
|
|
18
|
-
]
|
|
19
|
-
|
|
20
|
-
const range = max ? max - min : min
|
|
21
|
-
let str = ''
|
|
22
|
-
const length = arr.length - 1
|
|
23
|
-
|
|
24
|
-
for (let i = 0; i < range; i++) {
|
|
25
|
-
str += arr[Math.round(Math.random() * length)]
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
return str
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
return `${new Date().getTime() + (diff || 0)}:${rnd(8)}`
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function getMac(nonce, macKey, userId) {
|
|
35
|
-
const macContent = [nonce, 'POST', `/id=${userId}`, 'uc.im', ''].join('\n')
|
|
36
|
-
return new Sha(macContent, 'TEXT').getHMAC(macKey, 'TEXT', 'SHA-256', 'B64')
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export default (token, accountInfo) => {
|
|
40
|
-
IMCoreChatroom.use({
|
|
41
|
-
name: 'IMCoreChatroom',
|
|
42
|
-
install(NDIM) {
|
|
43
|
-
NDIM.intercept('getAuth', () => {
|
|
44
|
-
const uc = getUCInstance()
|
|
45
|
-
if (uc.getAuth) {
|
|
46
|
-
return uc.getAuth()
|
|
47
|
-
}
|
|
48
|
-
const {
|
|
49
|
-
diff,
|
|
50
|
-
mac_key: macKey,
|
|
51
|
-
access_token: accessToken
|
|
52
|
-
} = token
|
|
53
|
-
const nonce = getNonce(diff)
|
|
54
|
-
const auth = {
|
|
55
|
-
nonce,
|
|
56
|
-
mac: getMac(nonce, macKey, accountInfo.user_id),
|
|
57
|
-
access_token: accessToken
|
|
58
|
-
}
|
|
59
|
-
console.log(auth)
|
|
60
|
-
return auth
|
|
61
|
-
})
|
|
62
|
-
}
|
|
63
|
-
})
|
|
64
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import IMCoreChatroom from '@ndim/chatroom'
|
|
2
|
-
import get from 'lodash/get'
|
|
3
|
-
|
|
4
|
-
import imChatroom from '../../imChatroom'
|
|
5
|
-
import { getChatroomConversationId } from '../../../util/chatroom'
|
|
6
|
-
|
|
7
|
-
export default () => {
|
|
8
|
-
IMCoreChatroom.use({
|
|
9
|
-
name: 'IMCoreChatroom',
|
|
10
|
-
install(NDIM) {
|
|
11
|
-
NDIM.intercept('getConversationId', () => {
|
|
12
|
-
const conversationId = getChatroomConversationId()
|
|
13
|
-
if (conversationId) {
|
|
14
|
-
return conversationId
|
|
15
|
-
}
|
|
16
|
-
return imChatroom.getRoomInfo().then((chatroom) => get(chatroom, 'room.convid'))
|
|
17
|
-
})
|
|
18
|
-
}
|
|
19
|
-
})
|
|
20
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import IMCoreChatroom from '@ndim/chatroom'
|
|
2
|
-
import UAParser from 'ua-parser-js'
|
|
3
|
-
|
|
4
|
-
import urlConfig from '../../../config/url'
|
|
5
|
-
|
|
6
|
-
function getDeviceInfo() {
|
|
7
|
-
const uaParser = new UAParser()
|
|
8
|
-
const result = uaParser.getResult()
|
|
9
|
-
const { browser, os, device } = result
|
|
10
|
-
|
|
11
|
-
// 将重要的设备信息提取出来拼接,
|
|
12
|
-
// 因为:WebSocket关闭代码的定义非常严格,并且关闭原因短语/消息的长度不能超过123个字符(这是有意的websocket限制)。
|
|
13
|
-
// 而服务端会将device_name、device_info信息设置在close reason 中。
|
|
14
|
-
// 其中device_name: WebIM占用了18个字符,device_info: 占用了12个字符,
|
|
15
|
-
// 故将device_info信息的长度设置在80个字符以内,剩余13个字符作为预留。斟酌执行只设置以下几个信息,并根据重要程度做了优先级排序。
|
|
16
|
-
const infos = [os.name, os.version, browser.name, browser.version, device.vendor]
|
|
17
|
-
|
|
18
|
-
let deviceInfo = ''
|
|
19
|
-
infos.forEach((value, index) => {
|
|
20
|
-
if (value && deviceInfo.length + value.length + 1 <= 80) {
|
|
21
|
-
if (index !== 0) {
|
|
22
|
-
deviceInfo += ' '
|
|
23
|
-
}
|
|
24
|
-
deviceInfo += value
|
|
25
|
-
}
|
|
26
|
-
})
|
|
27
|
-
|
|
28
|
-
return deviceInfo
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export default (
|
|
32
|
-
// token,
|
|
33
|
-
// accountInfo
|
|
34
|
-
) => {
|
|
35
|
-
IMCoreChatroom.use({
|
|
36
|
-
name: 'IMCoreChatroom',
|
|
37
|
-
install(NDIM) {
|
|
38
|
-
NDIM.intercept('getLoginInfo', () => ({
|
|
39
|
-
device_name: 'im-chat-room', // 设备名称
|
|
40
|
-
device_info: getDeviceInfo(), // 客户端设备信息, 客户端自定义设备信息,用于透传踢人通知的设备信息
|
|
41
|
-
// network_type: 'WIFI', // WIFI,2G,3G,4G
|
|
42
|
-
// version: '客户端版本',
|
|
43
|
-
// orgid: get(accountInfo, 'org_id', ''), // 组织id
|
|
44
|
-
'sdp-app-id': urlConfig.sdpAppId // 客户端应用id,必填
|
|
45
|
-
}))
|
|
46
|
-
}
|
|
47
|
-
})
|
|
48
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import IMCoreChatroom from '@ndim/chatroom'
|
|
2
|
-
|
|
3
|
-
import appConfig from '../../../config/app'
|
|
4
|
-
|
|
5
|
-
export default () => {
|
|
6
|
-
IMCoreChatroom.use({
|
|
7
|
-
name: 'IMCoreChatroom',
|
|
8
|
-
install(NDIM) {
|
|
9
|
-
NDIM.intercept('getPlatformType', () => appConfig.get('platform'))
|
|
10
|
-
}
|
|
11
|
-
})
|
|
12
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import IMCoreChatroom from '@ndim/chatroom'
|
|
2
|
-
import IMPluginMessage from '@ndim/plugin-message'
|
|
3
|
-
|
|
4
|
-
import getAuthPlugin from './getAuth'
|
|
5
|
-
import getConversationIdPlugin from './getConversationId'
|
|
6
|
-
import getExtInfoPlugin from './getExtInfo'
|
|
7
|
-
import getLoginInfoPlugin from './getLoginInfo'
|
|
8
|
-
import getPlatformTypePlugin from './getPlatformType'
|
|
9
|
-
|
|
10
|
-
export default (token, accountInfo) => {
|
|
11
|
-
[
|
|
12
|
-
getAuthPlugin,
|
|
13
|
-
getConversationIdPlugin,
|
|
14
|
-
getExtInfoPlugin,
|
|
15
|
-
getLoginInfoPlugin,
|
|
16
|
-
getPlatformTypePlugin
|
|
17
|
-
].forEach((plugin) => {
|
|
18
|
-
plugin(token, accountInfo)
|
|
19
|
-
})
|
|
20
|
-
|
|
21
|
-
IMCoreChatroom.use(IMPluginMessage)
|
|
22
|
-
}
|
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
import Long from 'long'
|
|
2
|
-
import get from 'lodash/get'
|
|
3
|
-
|
|
4
|
-
import jsonBigInt from '../../../util/jsonBigInt'
|
|
5
|
-
import { getCurrentAccountId } from '../../../util/account'
|
|
6
|
-
|
|
7
|
-
import { MessageType, MessageHeader } from '../constants'
|
|
8
|
-
import parser from './parser'
|
|
9
|
-
|
|
10
|
-
export const transferStringToLong = (value) => Long.fromString(value, true)
|
|
11
|
-
|
|
12
|
-
export const transferLongToString = (value) => {
|
|
13
|
-
if (typeof value === 'object') {
|
|
14
|
-
const message = {
|
|
15
|
-
...value
|
|
16
|
-
}
|
|
17
|
-
Object.keys(message).forEach((key) => {
|
|
18
|
-
if (Long.isLong(message[key])) {
|
|
19
|
-
message[key] = message[key].toString()
|
|
20
|
-
}
|
|
21
|
-
})
|
|
22
|
-
return message
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return value.toString()
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const getMessageSender = (_parsedContent) => {
|
|
29
|
-
try {
|
|
30
|
-
return JSON.parse(get(_parsedContent, `headers.${MessageHeader.ContentSender}`))
|
|
31
|
-
} catch (e) {
|
|
32
|
-
return null
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
const parseContent = (content) => {
|
|
37
|
-
const _parsedContent = parser.parse(content)
|
|
38
|
-
|
|
39
|
-
const contentSender = getMessageSender(_parsedContent)
|
|
40
|
-
if (contentSender) {
|
|
41
|
-
_parsedContent.contentSender = contentSender
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
return _parsedContent
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
// 解析消息内容,返回解析结果
|
|
48
|
-
export const parseMessageContent = (content) => {
|
|
49
|
-
let _parsedContent
|
|
50
|
-
if (content) {
|
|
51
|
-
_parsedContent = typeof content === 'string' ? parseContent(content) : content
|
|
52
|
-
} else {
|
|
53
|
-
_parsedContent = {
|
|
54
|
-
type: MessageType.Error,
|
|
55
|
-
data: null
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
return _parsedContent
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
export const parseMessage = (message, reserveMessage) => {
|
|
62
|
-
const { content } = message
|
|
63
|
-
let _parsedContent
|
|
64
|
-
let _content = content
|
|
65
|
-
if (content) {
|
|
66
|
-
_parsedContent = typeof content === 'string' ? parseContent(content) : content
|
|
67
|
-
|
|
68
|
-
if (_parsedContent.type === MessageType.Error && reserveMessage) {
|
|
69
|
-
const reserveContent = reserveMessage.content
|
|
70
|
-
if (reserveContent) {
|
|
71
|
-
_content = reserveContent
|
|
72
|
-
_parsedContent = parseContent(reserveContent)
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
} else {
|
|
76
|
-
_parsedContent = {
|
|
77
|
-
type: MessageType.Error,
|
|
78
|
-
data: null
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
const parsedMessage = {
|
|
83
|
-
...message,
|
|
84
|
-
_parsedContent,
|
|
85
|
-
content: _content
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
if (_parsedContent.type === MessageType.FlexBox) {
|
|
89
|
-
return transformFlexBoxMessage(parsedMessage)
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
console.log('parseMessage:', parsedMessage)
|
|
93
|
-
return parsedMessage
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
export const parseMessages = (messages) => messages.map((message) => parseMessage(message))
|
|
97
|
-
|
|
98
|
-
export const formatMessages = (messages) => parseMessages(messages.map((message) => ({
|
|
99
|
-
...message,
|
|
100
|
-
_localInfo: {
|
|
101
|
-
id: message.id,
|
|
102
|
-
index: 0
|
|
103
|
-
},
|
|
104
|
-
_direction: message.from === getCurrentAccountId() ? 'up' : 'down'
|
|
105
|
-
})))
|
|
106
|
-
|
|
107
|
-
// flexbox/json 消息转换
|
|
108
|
-
function transformFlexBoxMessage(message) {
|
|
109
|
-
const headers = get(message, '_parsedContent.headers')
|
|
110
|
-
|
|
111
|
-
// 改变消息类型
|
|
112
|
-
headers[MessageHeader.ContentType] = `${MessageType.CustomFlexBox}/xml`
|
|
113
|
-
|
|
114
|
-
// 移除消息头上设置的模板信息 - 坚决不认消息头的模板信息!!!
|
|
115
|
-
delete headers[MessageHeader.LanguageTemplate]
|
|
116
|
-
delete headers[MessageHeader.SupportLanguages]
|
|
117
|
-
delete headers[MessageHeader.LanguageParameter]
|
|
118
|
-
|
|
119
|
-
let flexbox = get(message, '_parsedContent.data.json.flexbox')
|
|
120
|
-
|
|
121
|
-
// 将消息中的flexbox信息更新到模板信息中
|
|
122
|
-
const attrs = get(message, 'attrs', [])
|
|
123
|
-
const flexboxAttr = attrs.find((attr) => attr.key === 'flexbox')
|
|
124
|
-
if (flexboxAttr && flexboxAttr.value) {
|
|
125
|
-
const flexboxData = jsonBigInt.parse(flexboxAttr.value)
|
|
126
|
-
const { state, ...others } = flexboxData
|
|
127
|
-
flexbox = {
|
|
128
|
-
...flexbox,
|
|
129
|
-
...others,
|
|
130
|
-
_flexBoxState: String(state || 0)
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
const {
|
|
135
|
-
templateId,
|
|
136
|
-
'support-languages': supportLanguages,
|
|
137
|
-
'parameter-value': parameterValue,
|
|
138
|
-
'default-template': defaultTemplate,
|
|
139
|
-
_flexBoxState,
|
|
140
|
-
...data
|
|
141
|
-
} = flexbox
|
|
142
|
-
|
|
143
|
-
// 重新设置模板信息
|
|
144
|
-
if (templateId) {
|
|
145
|
-
headers[MessageHeader.LanguageTemplate] = templateId
|
|
146
|
-
}
|
|
147
|
-
if (supportLanguages) {
|
|
148
|
-
headers[MessageHeader.SupportLanguages] = supportLanguages
|
|
149
|
-
}
|
|
150
|
-
if (parameterValue) {
|
|
151
|
-
try {
|
|
152
|
-
headers[MessageHeader.LanguageParameter] = JSON.stringify(parameterValue)
|
|
153
|
-
} catch (e) {
|
|
154
|
-
console.log('parse language parameter error: ', e)
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
// 存储flexbox/json解析完后除去模板消息字段外的数据
|
|
159
|
-
headers['flexbox-json-data'] = JSON.stringify(data)
|
|
160
|
-
|
|
161
|
-
const headerString = Object.keys(headers).reduce((acc, key) => {
|
|
162
|
-
const result = `${acc}${key}:${headers[key]}\r\n`
|
|
163
|
-
return result
|
|
164
|
-
}, '')
|
|
165
|
-
|
|
166
|
-
// 转换成新的消息内容
|
|
167
|
-
const content = `${headerString}\r\n${defaultTemplate || ''}`
|
|
168
|
-
|
|
169
|
-
return {
|
|
170
|
-
...message,
|
|
171
|
-
_flexBoxState, // 保存消息 state
|
|
172
|
-
_flexBoxContent: message.content,
|
|
173
|
-
_defaultContent: defaultTemplate ? content : '', // 有defaultTemplate时需要直接设置_defaultContent,这样翻译的时候没有找到语言时也能正确解析消息
|
|
174
|
-
content,
|
|
175
|
-
_parsedContent: parseMessageContent(content)
|
|
176
|
-
}
|
|
177
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import MessageParser from '@sdp.nd/im-sdk-commons/lib/msg-parser'
|
|
2
|
-
|
|
3
|
-
import getUCInstance from '../../uc'
|
|
4
|
-
import cs from '../../cs'
|
|
5
|
-
import { chatroomServiceName } from '../../cs/constants'
|
|
6
|
-
|
|
7
|
-
export default new MessageParser({
|
|
8
|
-
base: {
|
|
9
|
-
getDefaultEmotionUrl: (
|
|
10
|
-
smileyData
|
|
11
|
-
) => {
|
|
12
|
-
const { filename } = smileyData.data
|
|
13
|
-
return `/im-chatroom/smiley/sys/${filename}.gif`
|
|
14
|
-
},
|
|
15
|
-
getPublicEmojiURL: ({
|
|
16
|
-
filename
|
|
17
|
-
}) => `/im-chatroom/smiley/emoji/${filename}`,
|
|
18
|
-
getPublicDownloadURL: (data) => {
|
|
19
|
-
const { id: dentryId, ...other } = data
|
|
20
|
-
return cs.getPublicDownloadURL({
|
|
21
|
-
serviceName: chatroomServiceName,
|
|
22
|
-
dentryId,
|
|
23
|
-
...other
|
|
24
|
-
})
|
|
25
|
-
},
|
|
26
|
-
getUserAvatarUrl: (uri) => `${getUCInstance().getAvatarURL({
|
|
27
|
-
userId: uri,
|
|
28
|
-
size: 80
|
|
29
|
-
})}&_=${Date.now()}`
|
|
30
|
-
},
|
|
31
|
-
highlight: {
|
|
32
|
-
keyword: '',
|
|
33
|
-
className: ''
|
|
34
|
-
}
|
|
35
|
-
})
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { getUserInfo } from '@/service/im'
|
|
2
|
-
|
|
3
|
-
const prefix = '__user_info'
|
|
4
|
-
|
|
5
|
-
export default async function getUserInfoWithCache(userId) {
|
|
6
|
-
let cacheUser = sessionStorage.getItem(`${prefix}-${userId}`)
|
|
7
|
-
if (cacheUser) {
|
|
8
|
-
cacheUser = JSON.parse(cacheUser)
|
|
9
|
-
return cacheUser
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
return getUserInfo(userId).then((user) => {
|
|
13
|
-
if (user) {
|
|
14
|
-
sessionStorage.setItem(`${prefix}-${userId}`, JSON.stringify(user))
|
|
15
|
-
}
|
|
16
|
-
return user
|
|
17
|
-
})
|
|
18
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import postal from 'postal'
|
|
2
|
-
import get from 'lodash/get'
|
|
3
|
-
import { actions } from '../../context/chatroom'
|
|
4
|
-
|
|
5
|
-
import { CTL_CMD } from '../../constants'
|
|
6
|
-
|
|
7
|
-
const ctlChannel = postal.channel('ctl')
|
|
8
|
-
|
|
9
|
-
// 置顶聊天室消息
|
|
10
|
-
ctlChannel.subscribe(CTL_CMD.LIVE_TOP_MESSAGES, (message) => {
|
|
11
|
-
const messages = get(message, '_parsedContent.data.json.ctl.message.items', [])
|
|
12
|
-
if (messages.length) {
|
|
13
|
-
actions.setChatroomStickedMessages(messages)
|
|
14
|
-
}
|
|
15
|
-
})
|
|
16
|
-
|
|
17
|
-
// 删除聊天室置顶消息
|
|
18
|
-
ctlChannel.subscribe(CTL_CMD.TOP_MESSAGES, () => {
|
|
19
|
-
actions.setChatroomStickedMessages()
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
-
export default ctlChannel
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import postal from 'postal'
|
|
2
|
-
import { COMMON_LIST_UPDATE_ACTION } from '@sdp.nd/im-web-components'
|
|
3
|
-
|
|
4
|
-
import EVENT from '../event'
|
|
5
|
-
|
|
6
|
-
const memberChannel = postal.channel('member')
|
|
7
|
-
|
|
8
|
-
// 聊天室成员登录
|
|
9
|
-
memberChannel.subscribe(EVENT.MEMBER_LOGIN, (message) => {
|
|
10
|
-
const { members = [], membercount } = message
|
|
11
|
-
|
|
12
|
-
if (members.length) {
|
|
13
|
-
memberChannel.publish(EVENT.COMMON_LIST_UPDATE, {
|
|
14
|
-
action: COMMON_LIST_UPDATE_ACTION.ADD,
|
|
15
|
-
items: members.map(({ uid }) => ({
|
|
16
|
-
user_id: uid
|
|
17
|
-
}))
|
|
18
|
-
})
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
memberChannel.publish(EVENT.CHATROOM_MEMBER_COUNT_UPDATE, membercount)
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
// 聊天室成员登出
|
|
25
|
-
memberChannel.subscribe(EVENT.MEMBER_LOGOUT, (message) => {
|
|
26
|
-
const { members = [], membercount } = message
|
|
27
|
-
|
|
28
|
-
if (members.length) {
|
|
29
|
-
memberChannel.publish(EVENT.COMMON_LIST_UPDATE, {
|
|
30
|
-
action: COMMON_LIST_UPDATE_ACTION.DELETE,
|
|
31
|
-
items: members.map(({ uid }) => ({
|
|
32
|
-
user_id: uid
|
|
33
|
-
}))
|
|
34
|
-
})
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
memberChannel.publish(EVENT.CHATROOM_MEMBER_COUNT_UPDATE, membercount)
|
|
38
|
-
})
|
|
39
|
-
|
|
40
|
-
export default memberChannel
|