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 end
else else
uid_logger_error("shixun is not exist") uid_logger_error("shixun is not exist")
# result = false # 找TPI的版本库是不是自己
result = true # 为了测试跳出 myshixun = Myshixun.find_by(repo_name: repo_name)
result = (myshixun.present? && system_user&.id == myshixun.user_id ? true : false)
end end
end 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.play_url url_base64_encode(video.play_url)
json.file_url url_base64_encode(video.file_url) json.file_url url_base64_encode(video.file_url)
json.play_duration video.video_play_duration json.play_duration video.video_play_duration

@ -1,4 +1,15 @@
json.count @count json.count @count
json.videos @videos do |video| 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 end

@ -133,11 +133,9 @@ class TPIContextProvider extends Component {
}) })
} }
componentWillMount () {
// 拦截判断是否离开当前页面
}
componentWillUnmount() { componentWillUnmount() {
this.costTimeInterval && window.clearInterval(this.costTimeInterval) this.costTimeInterval && window.clearInterval(this.costTimeInterval)
} }
componentDidMount() { componentDidMount() {
@ -195,6 +193,8 @@ class TPIContextProvider extends Component {
if (window.location.port == 3007) { if (window.location.port == 3007) {
testPath = 'http://test-newweb.educoder.net' testPath = 'http://test-newweb.educoder.net'
} }
// var url = `${testPath}/api/v1/games/${ game.identifier }/cost_time` // var url = `${testPath}/api/v1/games/${ game.identifier }/cost_time`
var url = `${testPath}/api/tasks/${ game.identifier }/cost_time${getRandomNumber()}` var url = `${testPath}/api/tasks/${ game.identifier }/cost_time${getRandomNumber()}`
window.$.ajax({ window.$.ajax({

@ -108,7 +108,6 @@ class Video extends Component {
setVideoVisible = (flag) => { setVideoVisible = (flag) => {
this.setState({ this.setState({
videoVisible: flag videoVisible: flag
}) })
@ -236,14 +235,15 @@ class Video extends Component {
className="showVideoModal" className="showVideoModal"
width={800 - 1} 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} <Input value={_inputValue}
className="dark" className="dark"
></Input> ></Input>
<ActionBtn className="copybtn" data-clipboard-text={_inputValue}>复制视频地址</ActionBtn> <ActionBtn className="copybtn" data-clipboard-text={_inputValue}>复制视频地址</ActionBtn>
</div> </div>}
</HeadlessModal> </HeadlessModal>
<div className="videoPanel"> <div className="videoPanel">
{ {

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

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

@ -11,6 +11,7 @@ import HeadlessModal from '../common/HeadlessModal'
import ClipboardJS from 'clipboard' import ClipboardJS from 'clipboard'
import VideoPlay from '../../../courses/Video/video-play'; import VideoPlay from '../../../courses/Video/video-play';
import { logWatchHistory } from '../../../../services/video-service'; import { logWatchHistory } from '../../../../services/video-service';
import { Base64 } from 'js-base64';
function useModal(initValue) { function useModal(initValue) {
const [visible, setVisible] = useState(initValue) const [visible, setVisible] = useState(initValue)
@ -250,7 +251,9 @@ function InfoVideo(props) {
}); });
} }
function getCopyText(file_url, cover_url) { 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 _inputValue = getCopyText(videoId.file_url, videoId.cover_url);
@ -268,7 +271,7 @@ function InfoVideo(props) {
className="showVideoModal" className="showVideoModal"
width={800 - 1} 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"> <div className="df copyLine">
<Input value={_inputValue} <Input value={_inputValue}
className="dark" className="dark"

Loading…
Cancel
Save