diff --git a/public/react/src/modules/user/usersInfo/video/VideoUploadList.js b/public/react/src/modules/user/usersInfo/video/VideoUploadList.js index ecea2a07d..49529bdd8 100644 --- a/public/react/src/modules/user/usersInfo/video/VideoUploadList.js +++ b/public/react/src/modules/user/usersInfo/video/VideoUploadList.js @@ -19,7 +19,7 @@ const MAX_FILE_SIZE = 500 let noUploads = true function VideoUploadList (props) { - + // const [videos, setvideos] = useState([]); const [state, dispatch] = useReducer(reducer, initialState); const theme = useContext(ThemeContext) @@ -54,7 +54,7 @@ function VideoUploadList (props) { const username = props.match.params.username || props.CourseUser; const { showNotification, history } = props; const uploaderOptions = { - + } function onUploadChange (e) { var file = e.target.files[0] @@ -63,18 +63,21 @@ function VideoUploadList (props) { return } // avi、flv、f4v、m4v、mov、mp4、rmvb、swf、webm - if (file.name - && file.name.indexOf('.avi') == -1 && file.name.indexOf('.flv') == -1 - && file.name.indexOf('.f4v') == -1 && file.name.indexOf('.m4v') == -1 - && file.name.indexOf('.mov') == -1 && file.name.indexOf('.mp4') == -1 - && file.name.indexOf('.rmvb') == -1 && file.name.indexOf('.swf') == -1 - && file.name.indexOf('.webm') == -1 + if (file.name + && file.name.indexOf('.avi') == -1 && file.name.indexOf('.flv') == -1 + && file.name.indexOf('.f4v') == -1 && file.name.indexOf('.m4v') == -1 + && file.name.indexOf('.mov') == -1 && file.name.indexOf('.mp4') == -1 + && file.name.indexOf('.rmvb') == -1 && file.name.indexOf('.swf') == -1 + && file.name.indexOf('.webm') == -1 ) { showNotification(`不支持的视频格式`) clearInput() return; } - if (file.size >(parseInt(MAX_FILE_SIZE) * 1024 * 1024)) { + + if(props&&props.user.admin===true||props&&props.user.business===true){ + + }else if (file.size >(parseInt(MAX_FILE_SIZE) * 1024 * 1024)) { // 超过500m TODO clearInput() showNotification(`视频大小超过${MAX_FILE_SIZE}M`) @@ -95,11 +98,11 @@ function VideoUploadList (props) { var Title = file.name var userData = '{"Vod":{}}' - + if (!uploader) { - - getUploader(username, - { + + getUploader(username, + { // 重新创建 才会用最新的 dispatch create: !uploader, addFileSuccess: (uploadInfo) => { @@ -174,7 +177,7 @@ function VideoUploadList (props) { }, onUploadError: (uploadInfo) => { - + }, // 可能需要等lib加载完毕才能执行 gotUploader: (_uploader) => { @@ -204,9 +207,9 @@ function VideoUploadList (props) { } else { // uploader.cancelFile(index) } - + clearInput() - dispatch({type: 'removeVideo', index}) + dispatch({type: 'removeVideo', index}) // setvideos([...videos.splice(index, 1)]) } // uploader.deleteFile(index); @@ -219,7 +222,7 @@ function VideoUploadList (props) { doDelete(index, isSuccess) } }) - + } function onPublish() { // 下列这些参数只有是课堂里面上传视频才会有 @@ -259,13 +262,13 @@ function VideoUploadList (props) { } // login const { flag , CourseId } = props; - const urls = - flag ? + const urls = + flag ? 上传内容协议 : 上传内容协议 const protocolLine =