diff --git a/app/controllers/gits_controller.rb b/app/controllers/gits_controller.rb index 0767eab02..dc54fa1b6 100644 --- a/app/controllers/gits_controller.rb +++ b/app/controllers/gits_controller.rb @@ -68,8 +68,9 @@ class GitsController < ApplicationController end else uid_logger_error("shixun is not exist") - # result = false - result = true # 为了测试跳出 + # 找TPI的版本库是不是自己 + myshixun = Myshixun.find_by(repo_name: repo_name) + result = (myshixun.present? && system_user&.id == myshixun.user_id ? true : false) end end end diff --git a/app/views/users/videos/_video.json.jbuilder b/app/views/users/videos/_video.json.jbuilder index 707c0a5cf..5dd472f27 100644 --- a/app/views/users/videos/_video.json.jbuilder +++ b/app/views/users/videos/_video.json.jbuilder @@ -1,4 +1,4 @@ -json.extract! video, :id, :title, :cover_url, :file_url, :play_url, :vv, :user_id, :transcoded +json.extract! video, :id, :title, :cover_url, :vv, :user_id, :transcoded json.play_url url_base64_encode(video.play_url) json.file_url url_base64_encode(video.file_url) json.play_duration video.video_play_duration diff --git a/app/views/weapps/courses/course_videos.json.jbuilder b/app/views/weapps/courses/course_videos.json.jbuilder index bca028c47..12e1d514c 100644 --- a/app/views/weapps/courses/course_videos.json.jbuilder +++ b/app/views/weapps/courses/course_videos.json.jbuilder @@ -1,4 +1,15 @@ json.count @count json.videos @videos do |video| - json.partial! 'users/videos/video', locals: { video: video } + #json.partial! 'users/videos/video', locals: { video: video } + json.extract! video, :id, :title, :cover_url, :file_url, :play_url, :vv, :user_id, :transcoded + #json.play_url url_base64_encode(video.play_url) + #json.file_url url_base64_encode(video.file_url) + json.play_duration video.video_play_duration + json.published_at video.display_published_at + json.created_at video.display_created_at + json.updated_at video.display_updated_at + user = video.user + json.user_name user&.real_name + json.user_img url_to_avatar(user) + json.user_login user&.login end \ No newline at end of file diff --git a/public/react/src/context/TPIContextProvider.js b/public/react/src/context/TPIContextProvider.js index 291626038..ab9447fee 100644 --- a/public/react/src/context/TPIContextProvider.js +++ b/public/react/src/context/TPIContextProvider.js @@ -133,11 +133,9 @@ class TPIContextProvider extends Component { }) } - componentWillMount () { - // 拦截判断是否离开当前页面 - } componentWillUnmount() { + this.costTimeInterval && window.clearInterval(this.costTimeInterval) } componentDidMount() { @@ -195,6 +193,8 @@ class TPIContextProvider extends Component { if (window.location.port == 3007) { testPath = 'http://test-newweb.educoder.net' } + + // var url = `${testPath}/api/v1/games/${ game.identifier }/cost_time` var url = `${testPath}/api/tasks/${ game.identifier }/cost_time${getRandomNumber()}` window.$.ajax({ diff --git a/public/react/src/modules/courses/Video/Video.js b/public/react/src/modules/courses/Video/Video.js index aa70220c9..7d40e099f 100644 --- a/public/react/src/modules/courses/Video/Video.js +++ b/public/react/src/modules/courses/Video/Video.js @@ -108,7 +108,6 @@ class Video extends Component { setVideoVisible = (flag) => { - this.setState({ videoVisible: flag }) @@ -236,14 +235,15 @@ class Video extends Component { className="showVideoModal" width={800 - 1} > - {videoId && } + {this.state.videourl===null?'':videoId &&} + {/* {videoId && } */} -
+ {this.props.isAdmin()===false?'':
复制视频地址 -
+
}
{ diff --git a/public/react/src/modules/testpaper/Paperlibraryseeid.js b/public/react/src/modules/testpaper/Paperlibraryseeid.js index 064af7546..b39ead8d1 100644 --- a/public/react/src/modules/testpaper/Paperlibraryseeid.js +++ b/public/react/src/modules/testpaper/Paperlibraryseeid.js @@ -239,7 +239,7 @@ class Paperlibraryseeid extends Component {
- this.setCohetepaperbool(bool)} onSubmits={() => this.preservation()} url={urlsysl}> diff --git a/public/react/src/modules/testpaper/component/Listjihe.js b/public/react/src/modules/testpaper/component/Listjihe.js index 919d0dabb..fa3769fee 100644 --- a/public/react/src/modules/testpaper/component/Listjihe.js +++ b/public/react/src/modules/testpaper/component/Listjihe.js @@ -153,7 +153,7 @@ class Listjihe extends Component {

难度:{difficultys}

-
+

更新时间:{update_times} @@ -181,7 +181,10 @@ class Listjihe extends Component { { defaultActiveKey===0||defaultActiveKey==="0"? -

+
+

+ 发送至课堂 +

this.props.showmodelysl(items.id)}> 删除 @@ -218,7 +221,10 @@ class Listjihe extends Component { }

:Periofters===true? -
+
+

+ 发送至课堂 +

this.props.showmodelysl(items.id)}> 删除 @@ -236,7 +242,10 @@ class Listjihe extends Component { }

:Perioftersbols===true? -
+
+

+ 发送至课堂 +

{ this.props.Isitapopup&&this.props.Isitapopup==="true"? "" diff --git a/public/react/src/modules/user/usersInfo/video/InfosVideo.js b/public/react/src/modules/user/usersInfo/video/InfosVideo.js index 907243600..daf974cd2 100644 --- a/public/react/src/modules/user/usersInfo/video/InfosVideo.js +++ b/public/react/src/modules/user/usersInfo/video/InfosVideo.js @@ -11,6 +11,7 @@ import HeadlessModal from '../common/HeadlessModal' import ClipboardJS from 'clipboard' import VideoPlay from '../../../courses/Video/video-play'; import { logWatchHistory } from '../../../../services/video-service'; +import { Base64 } from 'js-base64'; function useModal(initValue) { const [visible, setVisible] = useState(initValue) @@ -250,8 +251,10 @@ function InfoVideo(props) { }); } function getCopyText(file_url, cover_url) { - return `` - } + if(file_url){ + return `` + } + } const _inputValue = getCopyText(videoId.file_url, videoId.cover_url); const sorts = sortKey.split('-') @@ -268,7 +271,7 @@ function InfoVideo(props) { className="showVideoModal" width={800 - 1} > - {videoModalObj.visible && } + {videoModalObj.visible && }