From d43599d8aed4cacf6923f30bb79597a399ca2214 Mon Sep 17 00:00:00 2001 From: harry Date: Fri, 13 Mar 2020 19:26:18 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=A7=86=E9=A2=91=E6=92=AD=E6=94=BE?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=96=B0=E5=A2=9E=E5=8F=82=E6=95=B0=E5=89=8D?= =?UTF-8?q?=E7=AB=AF=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 3 +++ .../react/src/modules/courses/Video/video-play/index.jsx | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 349c0cdc1..544539736 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ # Ignore bundler config. /.bundle /bundle +/node_modules # Ignore lock config file *.lock @@ -46,6 +47,8 @@ /public/h5build /public/npm-debug.log +/dist + # avatars /public/images/avatars diff --git a/public/react/src/modules/courses/Video/video-play/index.jsx b/public/react/src/modules/courses/Video/video-play/index.jsx index 84b465014..cfc5ad343 100644 --- a/public/react/src/modules/courses/Video/video-play/index.jsx +++ b/public/react/src/modules/courses/Video/video-play/index.jsx @@ -43,7 +43,7 @@ export default ({ src, videoId, logWatchHistory, courseId = null }) => { let isSeeking = false let pos = []//播放时间点集 - const log = useCallback((callback) => { + const log = useCallback((callback, isEnd = false) => { let params = {} if (logId) { params['log_id'] = logId @@ -59,6 +59,9 @@ export default ({ src, videoId, logWatchHistory, courseId = null }) => { params['duration'] = totalDuration params['device'] = device } + if (isEnd) { + params['ed'] = "1" + } async function getLogId() { isLoging = true let id = await logWatchHistory(params) @@ -119,7 +122,7 @@ export default ({ src, videoId, logWatchHistory, courseId = null }) => { isLoging = false isSeeking = false pos = [] - }) + }, true) } function onTimeupdate() { From 0f509921cc25a06eae1ed577bc91673e5f4f8f0d Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Fri, 13 Mar 2020 19:49:26 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E8=B5=84=E6=BA=90=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/files_controller.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index 6a7f7b4b0..8e6356201 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -367,9 +367,9 @@ class FilesController < ApplicationController @category_name = category.try(:module_name) else @category = CourseSecondCategory.find category_id - @category_id = category.try(:id) - @category_name = category.try(:name) - @parent_category_id = category&.parent_id.to_i + @category_id = @category.try(:id) + @category_name = @category.try(:name) + @parent_category_id = @category&.parent_id.to_i end end