diff --git a/app/controllers/live_links_controller.rb b/app/controllers/live_links_controller.rb
index f4b49d4aa..fe2de4afe 100644
--- a/app/controllers/live_links_controller.rb
+++ b/app/controllers/live_links_controller.rb
@@ -2,7 +2,8 @@ class LiveLinksController < ApplicationController
before_action :require_login
before_action :find_course, only: [:index, :create]
before_action :user_course_identity, :teacher_allowed, only: [:create]
- before_action :edit_auth, only: [:edit, :update, :destroy]
+ before_action :edit_auth, only: [:edit, :update]
+ before_action :delete_auth, only: [:destroy]
def index
lives = @course.live_links
@@ -58,6 +59,10 @@ class LiveLinksController < ApplicationController
end
def edit_auth
+ tip_exception(403, "无权限操作") unless current_user.id == current_live.user_id || current_user.admin_or_business?
+ end
+
+ def delete_auth
tip_exception(403, "无权限操作") unless current_user.id == current_live.user_id || current_user.admin?
end
end
\ No newline at end of file
diff --git a/app/models/live_link.rb b/app/models/live_link.rb
index 5dcfaf3d3..52c1e3657 100644
--- a/app/models/live_link.rb
+++ b/app/models/live_link.rb
@@ -8,6 +8,10 @@ class LiveLink < ApplicationRecord
validates :description, length: { maximum: 100, too_long: "不能超过100个字符" }
def op_auth?
+ user == User.current || User.current.admin_or_business?
+ end
+
+ def delete_auth?
user == User.current || User.current.admin?
end
end
diff --git a/app/views/live_links/index.json.jbuilder b/app/views/live_links/index.json.jbuilder
index e951f24bc..e497a068b 100644
--- a/app/views/live_links/index.json.jbuilder
+++ b/app/views/live_links/index.json.jbuilder
@@ -5,6 +5,7 @@ json.lives @lives do |live|
json.author_login live.user.login
json.author_img url_to_avatar(live.user)
json.op_auth live.op_auth?
+ json.delete_auth live.delete_auth?
json.created_at live.created_at.strftime('%Y-%m-%d')
end
json.my_live_id @my_live_id
diff --git a/public/react/src/modules/courses/Video/Live.js b/public/react/src/modules/courses/Video/Live.js
index f8c39a000..7d0e01d2b 100644
--- a/public/react/src/modules/courses/Video/Live.js
+++ b/public/react/src/modules/courses/Video/Live.js
@@ -1,9 +1,14 @@
import React,{ Component } from "react";
-import { Switch , Pagination } from 'antd';
-import { NoneData } from 'educoder';
+import { Pagination } from 'antd';
+// import { NoneData } from 'educoder';
import LiveItem from './LiveItem';
import './video.css';
+
+import bilibili from './images/bilibili.png';
+import tencent from './images/tencent.png';
+import WeiBaiTong from './images/WeiBaiTong.png';
+import douyu from './images/douyu.jpg';
class Live extends Component{
render(){
@@ -11,10 +16,31 @@ class Live extends Component{
return(
+
EduCoder支持所有第三方直播平台,特别推荐:
+
{
lives && lives.length > 0 ?
- 共 {liveData && liveData.total_count} 个视频
+ 共 {liveData && liveData.total_count} 个视频
{
lives.map((item,key)=>{
@@ -38,9 +64,10 @@ class Live extends Component{
}
:
-
-
-
+ ""
+ //
+ //
+ //
}
)
diff --git a/public/react/src/modules/courses/Video/LiveItem.js b/public/react/src/modules/courses/Video/LiveItem.js
index 095a8fc62..a2fff5b98 100644
--- a/public/react/src/modules/courses/Video/LiveItem.js
+++ b/public/react/src/modules/courses/Video/LiveItem.js
@@ -72,13 +72,18 @@ class LiveItem extends Component{
创建时间:{item.created_at}
- {
- item.op_auth ?
+
- setLiveId(item.id)}>编辑
- this.deleteLive(item.id)}>删除
- :""
- }
+ {
+ item.op_auth ?
+ setLiveId(item.id)}>编辑:""
+ }
+ {
+ item.delete_auth ?
+ this.deleteLive(item.id)}>删除
+ :""
+ }
+
)
diff --git a/public/react/src/modules/courses/Video/LiveNew.js b/public/react/src/modules/courses/Video/LiveNew.js
index 897dd714a..a295a6fe5 100644
--- a/public/react/src/modules/courses/Video/LiveNew.js
+++ b/public/react/src/modules/courses/Video/LiveNew.js
@@ -137,10 +137,10 @@ class LiveNew extends Component{
)}
-
+ {/*
EduCoder推荐您使用腾讯课堂进行直播
操作指引
-
+ */}
取消
diff --git a/public/react/src/modules/courses/Video/VideoIndex.js b/public/react/src/modules/courses/Video/VideoIndex.js
index c24b0f8d1..774f35de9 100644
--- a/public/react/src/modules/courses/Video/VideoIndex.js
+++ b/public/react/src/modules/courses/Video/VideoIndex.js
@@ -179,7 +179,7 @@ class VideoIndex extends Component{
}
render(){
const { videos , upload , videoData , type , liveData , lives , page , liveVisible , isSpining , liveId } = this.state;
- const { admin , is_teacher } = this.props.user;
+ const { admin , is_teacher , business } = this.props.user;
return(
{
- (admin || is_teacher) &&
+ (admin || is_teacher || business) &&
{
- upload ?
- this.uploadVideo(false)}>取消
+ type === "video" ?
+
+ {
+ upload ?
+ this.uploadVideo(false)}>取消
+ :
+ 上传视频
+ }
+
:
- 上传视频
+ 直播设置
}
- 直播设置
}
diff --git a/public/react/src/modules/courses/Video/images/WeiBaiTong.png b/public/react/src/modules/courses/Video/images/WeiBaiTong.png
new file mode 100644
index 000000000..db08c9c42
Binary files /dev/null and b/public/react/src/modules/courses/Video/images/WeiBaiTong.png differ
diff --git a/public/react/src/modules/courses/Video/images/bilibili.png b/public/react/src/modules/courses/Video/images/bilibili.png
new file mode 100644
index 000000000..10e189741
Binary files /dev/null and b/public/react/src/modules/courses/Video/images/bilibili.png differ
diff --git a/public/react/src/modules/courses/Video/images/douyu.jpg b/public/react/src/modules/courses/Video/images/douyu.jpg
new file mode 100644
index 000000000..52b8d4962
Binary files /dev/null and b/public/react/src/modules/courses/Video/images/douyu.jpg differ
diff --git a/public/react/src/modules/courses/Video/images/tencent.png b/public/react/src/modules/courses/Video/images/tencent.png
new file mode 100644
index 000000000..738bb3693
Binary files /dev/null and b/public/react/src/modules/courses/Video/images/tencent.png differ
diff --git a/public/react/src/modules/courses/Video/video.css b/public/react/src/modules/courses/Video/video.css
index c91e5477e..b44a33371 100644
--- a/public/react/src/modules/courses/Video/video.css
+++ b/public/react/src/modules/courses/Video/video.css
@@ -138,4 +138,16 @@
.liveModal .ant-col.ant-form-item-label{
height: 30px;
line-height: 30px;
+}
+.platform{
+ background: #fff;
+ display: flex;
+ align-items: center;
+ padding:20px 10px;
+ margin-bottom: 10px;
+}
+.platform > li{
+ margin-right: 80px;
+ display: flex;
+ align-items: center;
}
\ No newline at end of file
diff --git a/public/react/src/modules/user/usersInfo/video/VideoUploadList.js b/public/react/src/modules/user/usersInfo/video/VideoUploadList.js
index 6f6286727..60f94e779 100644
--- a/public/react/src/modules/user/usersInfo/video/VideoUploadList.js
+++ b/public/react/src/modules/user/usersInfo/video/VideoUploadList.js
@@ -15,7 +15,7 @@ import uploadHoverIcon from './images/upload_hover.png'
let uploader
const files = []
const MAX_FILE_COUNT = 3
-const MAX_FILE_SIZE = 200
+const MAX_FILE_SIZE = 500
let noUploads = true
function VideoUploadList (props) {
@@ -74,8 +74,8 @@ function VideoUploadList (props) {
clearInput()
return;
}
- if (file.size > 200 * 1024 * 1024) {
- // 超过200m TODO
+ if (file.size >(parseInt(MAX_FILE_SIZE) * 1024 * 1024)) {
+ // 超过500m TODO
clearInput()
showNotification(`视频大小超过${MAX_FILE_SIZE}M`)
return;
@@ -428,7 +428,7 @@ function VideoUploadList (props) {
>继续添加}
-
视频大小:不支持断点续传,单个视频文件最大200M;单次最多支持3个视频文件上传
+
视频大小:不支持断点续传,单个视频文件最大500M;单次最多支持3个视频文件上传
视频规格:avi、flv、f4v、m4v、mov、mp4、rmvb、swf、webm
温馨提示:请勿上传违法视频。平台将为每一个视频分配一个地址,您可以通过引用该地址将视频使用在实训项目等模块