Merge branch 'dev_chen' of http://bdgit.educoder.net/Hjqreturn/educoder into dev_chen

dev_chen
cxt 5 years ago
commit 096d1acd77

@ -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

@ -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

@ -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

@ -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({

@ -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 && <VideoPanel src={this.state.videourl===null?videoId.file_url:Base64.decode(videoId.file_url)} videoId={videoId.videoId} courseId={CourseId} logWatchHistory={logWatchHistory} />}
{this.state.videourl===null?'':videoId &&<VideoPanel src={Base64.decode(videoId.file_url)} videoId={videoId.videoId} courseId={CourseId} logWatchHistory={logWatchHistory} />}
{/* {videoId && <VideoPanel src={Base64.decode(videoId.file_url)} videoId={videoId.videoId} courseId={CourseId} logWatchHistory={logWatchHistory} />} */}
<div className="df copyLine" style={{}}>
{this.props.isAdmin()===false?'':<div className="df copyLine" style={{}}>
<Input value={_inputValue}
className="dark"
></Input>
<ActionBtn className="copybtn" data-clipboard-text={_inputValue}>复制视频地址</ActionBtn>
</div>
</div>}
</HeadlessModal>
<div className="videoPanel">
{

@ -239,7 +239,7 @@ class Paperlibraryseeid extends Component {
</div>
<Bottomsubmit {...this.props} {...this.state} bottomvalue={"发起考试"}
<Bottomsubmit {...this.props} {...this.state} bottomvalue={"发送至课堂"}
setCohetepaperbool={(bool)=>this.setCohetepaperbool(bool)}
onSubmits={() => this.preservation()} url={urlsysl}></Bottomsubmit>
</div>

@ -153,7 +153,7 @@ class Listjihe extends Component {
<p className="sjtitles ml48">难度<span >{difficultys}</span></p>
</div>
<div className="w100s sortinxdirection mt11">
<div className="w65s sortinxdirection">
<div className="w50s sortinxdirection">
<p className='sjtitlesysl'>
更新时间<span>{update_times}</span>
@ -181,7 +181,10 @@ class Listjihe extends Component {
{
defaultActiveKey===0||defaultActiveKey==="0"?
<div className="w35s xaxisreverseorder">
<div className="w50s xaxisreverseorder">
<p className="selection xiaoshou">
<span className=" lh30">发送至课堂</span>
</p>
<p className="viewparsings xiaoshou mr25 " onClick={()=>this.props.showmodelysl(items.id)}>
<i className="iconfont icon-shanchu1 font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>删除</span>
@ -218,7 +221,10 @@ class Listjihe extends Component {
}
</div>
:Periofters===true?
<div className="w35s xaxisreverseorder">
<div className="w50s xaxisreverseorder">
<p className="selection xiaoshou">
<span className=" lh30">发送至课堂</span>
</p>
<p className="viewparsings xiaoshou mr25 " onClick={()=>this.props.showmodelysl(items.id)}>
<i className="iconfont icon-shanchu1 font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>删除</span>
@ -236,7 +242,10 @@ class Listjihe extends Component {
}
</div>
:Perioftersbols===true?
<div className="w35s xaxisreverseorder">
<div className="w50s xaxisreverseorder">
<p className="selection xiaoshou">
<span className=" lh30">发送至课堂</span>
</p>
{
this.props.Isitapopup&&this.props.Isitapopup==="true"?
""

@ -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 `<video src="${file_url}" controls="true" controlslist="nodownload" width="${DEFAULT_VIDEO_WIDTH_IN_MD}" height="${DEFAULT_VIDEO_HEIGHT_IN_MD}" poster="${cover_url}">您的浏览器不支持 video 标签。</video>`
}
if(file_url){
return `<video src="${Base64.decode(file_url)}" controls="true" controlslist="nodownload" width="${DEFAULT_VIDEO_WIDTH_IN_MD}" height="${DEFAULT_VIDEO_HEIGHT_IN_MD}" poster="${cover_url}">您的浏览器不支持 video 标签。</video>`
}
}
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 && <VideoPlay src={videoId.file_url} videoId={videoId.videoId} logWatchHistory={logWatchHistory} />}
{videoModalObj.visible && <VideoPlay src={Base64.decode(videoId.file_url)} videoId={videoId.videoId} logWatchHistory={logWatchHistory} />}
<div className="df copyLine">
<Input value={_inputValue}
className="dark"

Loading…
Cancel
Save