提交 a9e48f6b authored 作者: 王鹏飞's avatar 王鹏飞

fix: 取消自动刷新直播接口

上级 59f43674
...@@ -107,13 +107,10 @@ export default { ...@@ -107,13 +107,10 @@ export default {
clearInterval(this.timeInterval) clearInterval(this.timeInterval)
this.timeInterval = null this.timeInterval = null
} }
this.timeInterval = setInterval(() => { // 获取最新直播
cAction.Player.getNewLiveMsg().then(json => { this.getLatestLive()
if (json.status === 200) { // 定时获取最新直播
this.newLiveMsg = json.data this.timeInterval = setInterval(this.getLatestLive, 10000)
}
}).catch(e => { this.$message.error(e.message) }).finally(() => { })
}, 3000)
const loading = this.$loading({ lock: true, text: '', spinner: '', background: 'rgba(255, 255, 255, 0.9)' }) const loading = this.$loading({ lock: true, text: '', spinner: '', background: 'rgba(255, 255, 255, 0.9)' })
cAction.Course.getLearnFind().then(data => { cAction.Course.getLearnFind().then(data => {
...@@ -194,6 +191,14 @@ export default { ...@@ -194,6 +191,14 @@ export default {
/* 直接进直播 */ /* 直接进直播 */
goLive () { goLive () {
this.$router.push({ name: 'viewerCourseChapter', params: { sid: this.newLiveMsg.semester_id, cid: this.newLiveMsg.course_id, id: this.newLiveMsg.chapter_id } }) this.$router.push({ name: 'viewerCourseChapter', params: { sid: this.newLiveMsg.semester_id, cid: this.newLiveMsg.course_id, id: this.newLiveMsg.chapter_id } })
},
// 获取最新直播
getLatestLive() {
cAction.Player.getNewLiveMsg().then(json => {
if (json.status === 200) {
this.newLiveMsg = json.data
}
}).catch(e => { this.$message.error(e.message) })
} }
} }
} }
......
...@@ -393,9 +393,7 @@ export default { ...@@ -393,9 +393,7 @@ export default {
window.addEventListener('resize', this.resizeRoot.bind(this), false) window.addEventListener('resize', this.resizeRoot.bind(this), false)
/* 实时刷新数据 */ /* 实时刷新数据 */
if (this.timeHeart) { clearInterval(this.timeHeart); this.timeHeart = null } if (this.timeHeart) { clearInterval(this.timeHeart); this.timeHeart = null }
this.timeHeart = setInterval(() => { // this.timeHeart = setInterval(this.updatePages(), 3000)
this.updatePages()
}, 3000)
this.arrFn = this.initBindKeyfn() this.arrFn = this.initBindKeyfn()
}, },
destroyed () { destroyed () {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论