diff --git a/pagesB/play-video/play-video.nvue b/pagesB/play-video/play-video.nvue index c854426..3c8b513 100644 --- a/pagesB/play-video/play-video.nvue +++ b/pagesB/play-video/play-video.nvue @@ -63,15 +63,17 @@ onUnload() { console.log('页面销毁了') let course_video_id = this.videoList[this.currentIndex].course_video_id; - let params = { - course_video_id:course_video_id, - duration:parseInt(this.currentTime), - } - this.$requst.get('/api/course/create-browse-records',params).then(res=>{ - if(res.code == 0) { - console.log('观影记录提交成功',this.currentTime) + if(course_video_id) { + let params = { + course_video_id:course_video_id, + duration:parseInt(this.currentTime), } - }) + this.$requst.get('/api/course/create-browse-records',params).then(res=>{ + if(res.code == 0) { + console.log('观影记录提交成功',this.currentTime) + } + }) + } }, methods:{ // 视频滑动结束