Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

* 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder:
  ..
  调整bd引入方式
  权限调整
video_log
harry 5 years ago
commit 10834cab32

@ -38,6 +38,7 @@ module Educoderplus
origins '*'
# location of your api
resource '/*', :headers => :any, :methods => [:get, :post, :delete, :options, :put]
resource 'http://outin-396971199eed11e991a100163e1c7426.oss-cn-shanghai.aliyuncs.com/*', :headers => :any, :methods => [:get, :post, :delete, :options, :put]
end
end
end

@ -195,7 +195,7 @@ function generateNewIndexJsp() {
let cdnHost = 'https://shixun.educoder.net'
cdnHost = 'https://ali-cdn.educoder.net'
cdnHost = ''
var mainRegex = /<script type="text\/javascript" src="\/react\/build\/.\/static\/js\/main.([a-zA-Z0-9]{8,}).js"><\/script>/
var matchResult = data.match(mainRegex)
@ -209,7 +209,9 @@ function generateNewIndexJsp() {
} else if (window.location.host == 'www.educoder.net') {
_host = 'https://ali-cdn.educoder.net/react/build/'
}
document.write('<script type="text/javascript" src="' + _host + 'js/js_min_all.js"><\\/script>');
document.write('<script type="text/javascript" src="' + _host + 'js/flv.min.js"><\\/script>');
document.write('<script type="text/javascript" src="' + _host + 'static/js/main.${matchResult[1]}.js"><\\/script>');
})()
</script>
@ -230,7 +232,7 @@ function generateNewIndexJsp() {
.replace(mainRegex, '')
// .replace('/react/build/./static/css/main', `${cdnHost}/react/build/./static/css/main`)
// .replace('/react/build/./static/js/main', `${cdnHost}/react/build/./static/js/main`)
// .replace(/https:\/\/testeduplus2.educoder.net/g, '');
// .replace(/http:\/\/testbdweb.educoder.net/g, '');

@ -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 ?
<Link to={`/users/${username}/videos/protocol?course=${CourseId}`} target="_blank" style={{color: theme.foreground_select}}>上传内容协议</Link>
:
<Link to={`/users/${username}/videos/protocol`} style={{color: theme.foreground_select}}>上传内容协议</Link>
const protocolLine = <div>上传视频即表示您已同意{urls}不得上传未经他人授权的作品</div>
return (
<div className={flag?"edu-back-white pb100 videoUploadList":"educontent videoUploadList"} style={{ marginBottom: `${flag?"0px":"200px"}` }}>
<Prompt
@ -391,7 +394,7 @@ function VideoUploadList (props) {
</div>
</React.Fragment>
}
<div className="section">
{/* noUploads */}
{noUploads && <div className="noUploads" style={{paddingTop: '72px'}} >
@ -400,7 +403,7 @@ function VideoUploadList (props) {
<img className="uploadHoverIcon" src={uploadHoverIcon} ></img>
</div>
<div style={{
color: '#000000',
fontSize: '18px',
@ -423,10 +426,10 @@ function VideoUploadList (props) {
})}
</div>
</Spin>
{state.videos && state.videos.length === MAX_FILE_COUNT &&
{state.videos && state.videos.length === MAX_FILE_COUNT &&
<div className="uploadTip">
{/* <i className="iconfont icon-tishi" style={{color: '#FF6F6F', verticalAlign: 'text-bottom'}}></i> */}
<span>提示单次最多支持3个视频文件上传</span>
<span>提示单次最多支持3个视频文件上传</span>
</div>}
{(!noUploads && state.videos.length < MAX_FILE_COUNT) && <ActionBtn className="publishBtn" onClick={() => document.getElementById('fileUpload').click()}
@ -446,7 +449,7 @@ function VideoUploadList (props) {
>
添加更多视频
</Button>} */}
<div style={{}} className="publishRow">
<ActionBtn className="publishBtn" onClick={() => onPublish()}
>立即发布</ActionBtn>

Loading…
Cancel
Save