上传视频权限

dev_video
caicai8 5 years ago
parent 2a80248f08
commit b844bbc324

@ -142,12 +142,25 @@ class VideoIndex extends Component{
}) })
this.getList(page); this.getList(page);
} }
toUpload =()=> {
const { admin , is_teacher} = this.props.user;
if (admin || (is_teacher && this.props.checkIfProfessionalCertification())) {
this.setState({
upload:true
})
} else {
this.props.showProfessionalCertificationDialog();
}
}
render(){ render(){
const { count , videos , upload , visible , videoVisible , videoId } = this.state; const { count , videos , upload , visible , videoVisible , videoId } = this.state;
const CourseId=this.props.match.params.coursesId; const CourseId=this.props.match.params.coursesId;
const { login }= this.props.current_user; const { login }= this.props.user;
console.log(this.props); console.log(this.props);
// const operation = (is_teacher && professional_certification) || admin;
const _inputValue = videoId && this.getCopyText(videoId.file_url, videoId.cover_url); const _inputValue = videoId && this.getCopyText(videoId.file_url, videoId.cover_url);
@ -188,7 +201,7 @@ class VideoIndex extends Component{
upload ? upload ?
<WordsBtn style="grey" className="font-16" onClick={()=>this.uploadVideo(false)}>取消</WordsBtn> <WordsBtn style="grey" className="font-16" onClick={()=>this.uploadVideo(false)}>取消</WordsBtn>
: :
<WordsBtn style="blue" className="font-16" onClick={()=>this.uploadVideo(true)}>上传视频</WordsBtn> <WordsBtn style="blue" className="font-16" onClick={this.toUpload}>上传视频</WordsBtn>
} }
</li> </li>
</p> </p>

Loading…
Cancel
Save