From b094010ad11c5424eebee3395c238a129d947685 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com>
Date: Sat, 17 Aug 2019 13:51:10 +0800
Subject: [PATCH 07/10] =?UTF-8?q?=E8=B0=83=E6=95=B4?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/react/src/modules/courses/Resource/Fileslistitem.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/public/react/src/modules/courses/Resource/Fileslistitem.js b/public/react/src/modules/courses/Resource/Fileslistitem.js
index 5f7c0fa83..d3405ebf5 100644
--- a/public/react/src/modules/courses/Resource/Fileslistitem.js
+++ b/public/react/src/modules/courses/Resource/Fileslistitem.js
@@ -129,7 +129,7 @@ class Fileslistitem extends Component{
const { checkBox,
discussMessage,
} = this.props;
-
+
return(
From e8dcb166756861f64edd9f5a487d60eb1b804bcd Mon Sep 17 00:00:00 2001
From: SylorHuang
Date: Sat, 17 Aug 2019 13:56:14 +0800
Subject: [PATCH 08/10] =?UTF-8?q?pdf=20=E9=A2=84=E8=A7=88=E4=BF=AE?=
=?UTF-8?q?=E6=94=B9=E6=B5=8B=E8=AF=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/attachments_controller.rb | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb
index dde7828c5..7617270a8 100644
--- a/app/controllers/attachments_controller.rb
+++ b/app/controllers/attachments_controller.rb
@@ -18,7 +18,8 @@ class AttachmentsController < ApplicationController
pdf_attachment = params[:disposition] || "attachment"
if pdf_attachment == "inline"
- render pdf: absolute_path(local_path(@file)), filename: @file.filename, disposition: 'inline', type: @file.content_type.presence || 'application/octet-stream'
+ send_data absolute_path(local_path(@file)),filename: @file.filename, disposition: 'inline',type: 'application/pdf'
+ # render pdf: absolute_path(local_path(@file)), filename: @file.filename, disposition: 'inline', type: @file.content_type.presence || 'application/octet-stream'
else
send_file(absolute_path(local_path(@file)), filename: @file.filename,stream:false, type: @file.content_type.presence || 'application/octet-stream')
end
From 476689314bcec5f32665fcd412de3bba975d3ed1 Mon Sep 17 00:00:00 2001
From: SylorHuang
Date: Sat, 17 Aug 2019 14:00:18 +0800
Subject: [PATCH 09/10] xxx
---
app/controllers/attachments_controller.rb | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb
index 7617270a8..d3317e99e 100644
--- a/app/controllers/attachments_controller.rb
+++ b/app/controllers/attachments_controller.rb
@@ -18,8 +18,7 @@ class AttachmentsController < ApplicationController
pdf_attachment = params[:disposition] || "attachment"
if pdf_attachment == "inline"
- send_data absolute_path(local_path(@file)),filename: @file.filename, disposition: 'inline',type: 'application/pdf'
- # render pdf: absolute_path(local_path(@file)), filename: @file.filename, disposition: 'inline', type: @file.content_type.presence || 'application/octet-stream'
+ send_file absolute_path(local_path(@file)),filename: @file.filename, disposition: 'inline',type: 'application/pdf'
else
send_file(absolute_path(local_path(@file)), filename: @file.filename,stream:false, type: @file.content_type.presence || 'application/octet-stream')
end
From 3c1d30a133a7e56090612b7473e1e613ed720622 Mon Sep 17 00:00:00 2001
From: p31729568
Date: Sat, 17 Aug 2019 14:03:18 +0800
Subject: [PATCH 10/10] video feature: add account check to api
---
app/controllers/users/video_auths_controller.rb | 2 +-
app/controllers/users/videos_controller.rb | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/controllers/users/video_auths_controller.rb b/app/controllers/users/video_auths_controller.rb
index 0eec4dffb..a7d41bce5 100644
--- a/app/controllers/users/video_auths_controller.rb
+++ b/app/controllers/users/video_auths_controller.rb
@@ -1,5 +1,5 @@
class Users::VideoAuthsController < Users::BaseController
- before_action :private_user_resources!, :require_auth_teacher!
+ before_action :private_user_resources!, :check_account, :require_auth_teacher!
def create
result = Videos::CreateAuthService.call(observed_user, create_params)
diff --git a/app/controllers/users/videos_controller.rb b/app/controllers/users/videos_controller.rb
index 1df726c0c..0ad3f87d6 100644
--- a/app/controllers/users/videos_controller.rb
+++ b/app/controllers/users/videos_controller.rb
@@ -1,5 +1,5 @@
class Users::VideosController < Users::BaseController
- before_action :private_user_resources!, :require_auth_teacher!
+ before_action :private_user_resources!, :check_account, :require_auth_teacher!
helper_method :current_video