From be852d200be6138778466bbc93bca31bba7b0fd2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com>
Date: Thu, 6 Feb 2020 21:07:47 +0800
Subject: [PATCH 04/34] =?UTF-8?q?=E8=B0=83=E8=AF=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../react/src/modules/courses/Resource/Fileslistitem.js | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/public/react/src/modules/courses/Resource/Fileslistitem.js b/public/react/src/modules/courses/Resource/Fileslistitem.js
index 3ac293de2..fe0574f56 100644
--- a/public/react/src/modules/courses/Resource/Fileslistitem.js
+++ b/public/react/src/modules/courses/Resource/Fileslistitem.js
@@ -215,10 +215,10 @@ class Fileslistitem extends Component{
const { checkBox,
discussMessage,index
} = this.props;
- console.log("Fileslistitem");
- console.log( document.domain);
- console.log(this.props.imhost);
- console.log( window.location.href);
+ // console.log("Fileslistitem");
+ // console.log( document.domain);
+ // console.log(this.props.imhost);
+ // console.log( window.location.href);
return(
From 39313bd726656a9f6950a450e66b5d54b7e03533 Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Thu, 6 Feb 2020 21:24:45 +0800
Subject: [PATCH 05/34] =?UTF-8?q?=E8=A7=86=E9=A2=91=E6=92=AD=E6=94=BE?=
=?UTF-8?q?=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/attachments_controller.rb | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb
index e0dd71467..0bfe9f124 100644
--- a/app/controllers/attachments_controller.rb
+++ b/app/controllers/attachments_controller.rb
@@ -17,9 +17,12 @@ class AttachmentsController < ApplicationController
redirect_to @file.cloud_url and return
end
- pdf_attachment = params[:disposition] || "attachment"
- if pdf_attachment == "inline"
+ type_attachment = params[:disposition] || "attachment"
+ if type_attachment == "inline"
send_file absolute_path(local_path(@file)),filename: @file.title, disposition: 'inline',type: 'application/pdf'
+ elsif type_attachment == "MP4"
+ response.header["Accept-Ranges"] = "bytes"
+ send_file absolute_path(local_path(@file)),filename: @file.title, disposition: 'inline',type: @file.content_type.presence || 'application/octet-stream'
else
send_file(absolute_path(local_path(@file)), filename: @file.title,stream:false, type: @file.content_type.presence || 'application/octet-stream')
end
From ad0e3cb128d23f567ac524402b35bf2cb739acce Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Thu, 6 Feb 2020 21:37:29 +0800
Subject: [PATCH 06/34] 1
---
app/controllers/attachments_controller.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb
index 0bfe9f124..eb962ad2e 100644
--- a/app/controllers/attachments_controller.rb
+++ b/app/controllers/attachments_controller.rb
@@ -22,7 +22,7 @@ class AttachmentsController < ApplicationController
send_file absolute_path(local_path(@file)),filename: @file.title, disposition: 'inline',type: 'application/pdf'
elsif type_attachment == "MP4"
response.header["Accept-Ranges"] = "bytes"
- send_file absolute_path(local_path(@file)),filename: @file.title, disposition: 'inline',type: @file.content_type.presence || 'application/octet-stream'
+ send_file absolute_path(local_path(@file)),filename: @file.title, disposition: 'inline',type: @file.content_type.presence || 'application/octet-stream', status: 206
else
send_file(absolute_path(local_path(@file)), filename: @file.title,stream:false, type: @file.content_type.presence || 'application/octet-stream')
end
From e7de4550cf202b4a9659bcd34d70674d8ed545ae Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Thu, 6 Feb 2020 21:41:26 +0800
Subject: [PATCH 07/34] 1
---
app/controllers/attachments_controller.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb
index eb962ad2e..107932cd8 100644
--- a/app/controllers/attachments_controller.rb
+++ b/app/controllers/attachments_controller.rb
@@ -22,7 +22,7 @@ class AttachmentsController < ApplicationController
send_file absolute_path(local_path(@file)),filename: @file.title, disposition: 'inline',type: 'application/pdf'
elsif type_attachment == "MP4"
response.header["Accept-Ranges"] = "bytes"
- send_file absolute_path(local_path(@file)),filename: @file.title, disposition: 'inline',type: @file.content_type.presence || 'application/octet-stream', status: 206
+ send_file absolute_path(local_path(@file)),filename: @file.title,type: @file.content_type.presence || 'application/octet-stream', status: 206
else
send_file(absolute_path(local_path(@file)), filename: @file.title,stream:false, type: @file.content_type.presence || 'application/octet-stream')
end
From f2cd502b2f10def116749114e2accc62b8b8026e Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Thu, 6 Feb 2020 21:48:18 +0800
Subject: [PATCH 08/34] 1
---
app/controllers/attachments_controller.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb
index 107932cd8..a3352aaca 100644
--- a/app/controllers/attachments_controller.rb
+++ b/app/controllers/attachments_controller.rb
@@ -22,7 +22,7 @@ class AttachmentsController < ApplicationController
send_file absolute_path(local_path(@file)),filename: @file.title, disposition: 'inline',type: 'application/pdf'
elsif type_attachment == "MP4"
response.header["Accept-Ranges"] = "bytes"
- send_file absolute_path(local_path(@file)),filename: @file.title,type: @file.content_type.presence || 'application/octet-stream', status: 206
+ send_file absolute_path(local_path(@file)),filename: @file.title,type: @file.content_type.presence || 'application/octet-stream'
else
send_file(absolute_path(local_path(@file)), filename: @file.title,stream:false, type: @file.content_type.presence || 'application/octet-stream')
end
From 1e834e18aae81d6de26b1f65b882ccbeb3ced755 Mon Sep 17 00:00:00 2001
From: daiao <358551898@qq.com>
Date: Thu, 6 Feb 2020 21:55:57 +0800
Subject: [PATCH 09/34] 1
---
app/controllers/attachments_controller.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb
index a3352aaca..184d63120 100644
--- a/app/controllers/attachments_controller.rb
+++ b/app/controllers/attachments_controller.rb
@@ -22,7 +22,7 @@ class AttachmentsController < ApplicationController
send_file absolute_path(local_path(@file)),filename: @file.title, disposition: 'inline',type: 'application/pdf'
elsif type_attachment == "MP4"
response.header["Accept-Ranges"] = "bytes"
- send_file absolute_path(local_path(@file)),filename: @file.title,type: @file.content_type.presence || 'application/octet-stream'
+ send_file absolute_path(local_path(@file)),filename: @file.title,type: @file.content_type.presence || 'application/octet-stream', x_sendfile: true
else
send_file(absolute_path(local_path(@file)), filename: @file.title,stream:false, type: @file.content_type.presence || 'application/octet-stream')
end
From 5ed217d5b5814f6185951e265e49aaff76355f7b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=9E=97?= <904079904@qq.com>
Date: Thu, 6 Feb 2020 22:22:24 +0800
Subject: [PATCH 10/34] =?UTF-8?q?=E8=B0=83=E8=AF=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../modules/courses/Resource/Fileslistitem.js | 24 +++++++++++--------
.../courses/coursesPublic/Showoldfiles.js | 5 +++-
2 files changed, 18 insertions(+), 11 deletions(-)
diff --git a/public/react/src/modules/courses/Resource/Fileslistitem.js b/public/react/src/modules/courses/Resource/Fileslistitem.js
index fe0574f56..27d8f471b 100644
--- a/public/react/src/modules/courses/Resource/Fileslistitem.js
+++ b/public/react/src/modules/courses/Resource/Fileslistitem.js
@@ -1,5 +1,5 @@
import React,{ Component } from "react";
-import { WordsBtn,ActionBtn,getmyUrl } from 'educoder';
+import { WordsBtn,ActionBtn,getmyUrl,getUrl } from 'educoder';
import {Tooltip,message,Input, Button} from 'antd';
import {Link} from 'react-router-dom';
import axios from 'axios'
@@ -60,7 +60,8 @@ class Fileslistitem extends Component{
if(list.content_type==="video/mp4"){
this.setState({
videoModalObj:true,
- file_url:"https://"+document.domain+list.url+'?file_name='+list.title,
+ // file_url:"https://"+document.domain+list.url+'?file_name='+list.title+"&disposition=MP4",
+ file_url:getUrl()+list.url+'?file_name='+list.title+'&disposition=MP4',
})
return
}else{
@@ -92,7 +93,9 @@ class Fileslistitem extends Component{
if(list.content_type==="video/mp4"){
this.setState({
videoModalObj:true,
- file_url:"https://"+document.domain+list.url+'?file_name='+list.title,
+ // file_url:"https://"+document.domain+list.url+'?file_name='+list.title+'&disposition=MP4',
+ file_url:getUrl()+list.url+'?file_name='+list.title+'&disposition=MP4',
+
})
return
}else{
@@ -126,10 +129,11 @@ class Fileslistitem extends Component{
}
Clicktobroadcastthevideo=(bool,url)=>{
- this.setState({
- videoModalObj:bool,
- file_url:"https://"+document.domain+url,
- })
+ this.setState({
+ videoModalObj:bool,
+ // file_url:"https://"+document.domain+url+'&disposition=MP4',
+ file_url:getUrl()+url+'&disposition=MP4',
+ })
}
@@ -231,8 +235,8 @@ class Fileslistitem extends Component{
width={800 - 1}
>
@@ -259,7 +263,7 @@ class Fileslistitem extends Component{
{...this.props}
visible={this.state.Showoldfiles}
allfiles={this.state.allfiles}
- Clicktobroadcastthevideo={(bool,urls)=>this.Clicktobroadcastthevideo(bool,urls)}
+ Clicktobroadcastthevideo={(bool,urls,index)=>this.Clicktobroadcastthevideo(bool,urls,index)}
closaoldfilesprops={this.closaoldfilesprops}
/>