From bb056d657de07aa2dbc22d6dfb85db53afa465e9 Mon Sep 17 00:00:00 2001 From: caicai8 <1149225589@qq.com> Date: Mon, 9 Mar 2020 23:01:40 +0800 Subject: [PATCH] bug --- public/react/src/modules/courses/Video/Video.js | 4 +++- .../react/src/modules/courses/Video/VideoIndex.js | 14 ++++++++------ .../react/src/modules/courses/Video/VideoLink.js | 14 ++++++++++++-- .../user/usersInfo/video/AliyunUploaderManager.js | 2 +- .../user/usersInfo/video/VideoUploadList.js | 6 +++--- 5 files changed, 27 insertions(+), 13 deletions(-) diff --git a/public/react/src/modules/courses/Video/Video.js b/public/react/src/modules/courses/Video/Video.js index 67387574c..1c0618497 100644 --- a/public/react/src/modules/courses/Video/Video.js +++ b/public/react/src/modules/courses/Video/Video.js @@ -184,6 +184,8 @@ class Video extends Component { render() { const { visible, videoVisible, videoId , moveVisible , moveVideoId } = this.state; const CourseId = this.props.match.params.coursesId; + const VID=this.props.match.params.videoId; + const login = this.props.user && this.props.user.login; const _inputValue = videoId && this.getCopyText(videoId.file_url, videoId.cover_url); @@ -224,7 +226,7 @@ class Video extends Component {
{ upload ? - uploadVideo()}> + uploadVideo()}> : { diff --git a/public/react/src/modules/courses/Video/VideoIndex.js b/public/react/src/modules/courses/Video/VideoIndex.js index f61e44d2f..c4dae59c2 100644 --- a/public/react/src/modules/courses/Video/VideoIndex.js +++ b/public/react/src/modules/courses/Video/VideoIndex.js @@ -73,6 +73,9 @@ class VideoIndex extends Component{ } componentDidUpdate = (prevProps) => { if(this.props.match.params.videoId !== prevProps.match.params.videoId ){ + this.setState({ + upload:false + }) const { page } = this.state; this.checkType("video",page); } @@ -246,6 +249,7 @@ class VideoIndex extends Component{ {videoData.category_name} : -
+
视频 直播 @@ -301,11 +305,9 @@ class VideoIndex extends Component{ videoId ? this.editDir(videoData && videoData.category_name,videoId)} className={"mr30 font-16"}>目录重命名 : - - 新建目录 - this.setLinkeVisible(true)}>增加外链:"" - + 新建目录 } + this.setLinkeVisible(true)}>增加外链 :"" } { @@ -321,7 +323,7 @@ class VideoIndex extends Component{ } : - this.setLinkeVisible(true)}>添加直播 + 添加直播 }
diff --git a/public/react/src/modules/courses/Video/VideoLink.js b/public/react/src/modules/courses/Video/VideoLink.js index 784d5a971..3aa8b6725 100644 --- a/public/react/src/modules/courses/Video/VideoLink.js +++ b/public/react/src/modules/courses/Video/VideoLink.js @@ -4,6 +4,14 @@ import axios from 'axios'; class VideoLink extends Component{ + componentDidUpdate=(prevProps)=>{ + if(prevProps.visible !== this.props.visible){ + this.props.form.setFieldsValue({ + name:undefined, + link:undefined + }) + } + } cancelNew=()=>{ const { setVisible } = this.props; setVisible && setVisible(false); @@ -22,10 +30,11 @@ class VideoLink extends Component{ handleSubmit=()=>{ this.props.form.validateFields((err, values) => { if(!err){ - const { coursesId } = this.props; + const { coursesId , videoId } = this.props; const url = `/courses/${coursesId}/course_videos.json`; axios.post(url,{ - ...values + ...values, + category_id:videoId }).then(result=>{ if(result){ const { notification , setVisible } = this.props; @@ -53,6 +62,7 @@ class VideoLink extends Component{ title={'添加外链'} footer={null} closable={false} + centered={true} >
diff --git a/public/react/src/modules/user/usersInfo/video/AliyunUploaderManager.js b/public/react/src/modules/user/usersInfo/video/AliyunUploaderManager.js index 3312473c4..ef2eaceda 100644 --- a/public/react/src/modules/user/usersInfo/video/AliyunUploaderManager.js +++ b/public/react/src/modules/user/usersInfo/video/AliyunUploaderManager.js @@ -73,7 +73,7 @@ function doCreateUploader (options) { const _random = '' // Math.random().toString().substring(3, 6)+'-' axios.post(createUrl, { title: _random+fileName, - file_name: _random+fileName + file_name: _random+fileName, }).then((response) => { // if (response.data.status == ) if(response){ diff --git a/public/react/src/modules/user/usersInfo/video/VideoUploadList.js b/public/react/src/modules/user/usersInfo/video/VideoUploadList.js index 49529bdd8..7855fc39a 100644 --- a/public/react/src/modules/user/usersInfo/video/VideoUploadList.js +++ b/public/react/src/modules/user/usersInfo/video/VideoUploadList.js @@ -226,7 +226,7 @@ function VideoUploadList (props) { } function onPublish() { // 下列这些参数只有是课堂里面上传视频才会有 - const { CourseId , CourseUser ,flag , successFunc } = props; + const { CourseId , CourseUser ,flag , successFunc , videoId } = props; if (state.videos.length == 0) { showNotification('请先上传视频') return; @@ -238,7 +238,8 @@ function VideoUploadList (props) { video_id: item.videoId, // todo title: item.title, - course_id:CourseId + course_id:CourseId, + category_id:videoId } }) }).then((response) => { @@ -268,7 +269,6 @@ function VideoUploadList (props) { : 上传内容协议 const protocolLine =
上传视频,即表示您已同意{urls},不得上传未经他人授权的作品
- return (