diff --git a/public/react/src/modules/courses/Resource/Fileslistitem.js b/public/react/src/modules/courses/Resource/Fileslistitem.js
index cd46570bd..6a1e16d6d 100644
--- a/public/react/src/modules/courses/Resource/Fileslistitem.js
+++ b/public/react/src/modules/courses/Resource/Fileslistitem.js
@@ -30,13 +30,13 @@ class Fileslistitem extends Component{
downloadfiles=(url,name)=>{
const aLink = document.createElement('a');
- document.body.appendChild(aLink);
aLink.style.display='none';
- aLink.download =name;
+ console.log(name)
+ aLink.setAttribute('download',name)
aLink.href = url;
+ document.body.appendChild(aLink);
aLink.click();
- document.body.removeChild(aLink);
-
+ // document.body.removeChild(aLink);
}
showfiles=(value)=>{
let {discussMessage,coursesId}=this.props
@@ -49,7 +49,7 @@ class Fileslistitem extends Component{
}).then((result)=>{
if(result.data.attachment_histories.length===0){
- this.downloadfiles(result.data.url,filesname)
+ this.downloadfiles(result.data.url,result.data.title)
}else{
this.setState({
Showoldfiles:true,
diff --git a/public/react/src/modules/courses/poll/PollListItem.js b/public/react/src/modules/courses/poll/PollListItem.js
index 16770ce43..8e6198eae 100644
--- a/public/react/src/modules/courses/poll/PollListItem.js
+++ b/public/react/src/modules/courses/poll/PollListItem.js
@@ -21,6 +21,7 @@ class PollListItem extends Component{
const IsAdmin =this.props.isAdmin();
const isStudent = this.props.isStudent();
+ const isNotMember = this.props.isNotMember();
let t= item.end_time ? moment(item.end_time) - moment() : 0;
return(
@@ -42,7 +43,7 @@ class PollListItem extends Component{
{item.polls_name}
}
{
- item.lock_status === 0 ? :""
+ item.lock_status === 0 ? :""
}
{
diff --git a/public/react/src/modules/courses/shixunHomework/Httpdownloads.js b/public/react/src/modules/courses/shixunHomework/Httpdownloads.js
new file mode 100644
index 000000000..11bd91f6b
--- /dev/null
+++ b/public/react/src/modules/courses/shixunHomework/Httpdownloads.js
@@ -0,0 +1,21 @@
+import {Base64} from 'js-base64';
+import axios from 'axios';
+
+
+// 导出实习报告批量zip 、xlsx 类型
+export function Internshipreportsy (url,struy,types,stingtype){
+ axios.get((url),{responseType: 'blob'}).then((response) => {
+ const blob = new Blob([response.data], { type: stingtype });
+ const downloadElement = document.createElement('a');
+ const href = window.URL.createObjectURL(blob);
+ const string = Base64.decode(response.headers['content-disposition'].split('=')[1]);
+ downloadElement.href = href;
+ downloadElement.download = string+struy+types;
+ document.body.appendChild(downloadElement);
+ downloadElement.click();
+ document.body.removeChild(downloadElement) ;// 下载完成移除元素
+ window.URL.revokeObjectURL(href) // 释放掉blob对象
+ }).catch((error) => {
+ console.log(error)
+ });
+}
\ No newline at end of file
diff --git a/public/react/src/modules/courses/shixunHomework/Listofworks.js b/public/react/src/modules/courses/shixunHomework/Listofworks.js
index 5dd049441..f09256230 100644
--- a/public/react/src/modules/courses/shixunHomework/Listofworks.js
+++ b/public/react/src/modules/courses/shixunHomework/Listofworks.js
@@ -5,6 +5,7 @@ import TraineetraininginformationModal from './TraineetraininginformationModal';
import ModulationModal from "../coursesPublic/ModulationModal";
import HomeworkModal from "../coursesPublic/HomeworkModal";
import {Base64} from 'js-base64';
+import {Internshipreportsy} from './Httpdownloads'
import {
Form,
Select,
@@ -1336,10 +1337,8 @@ class Listofworks extends Component {
});
}
-
- // 导出实习报告批量
- internshipreport = (url)=>{
- console.log("internshipreport");
+ /// 确认是否下载
+ confirmysl(url,type){
var struy="";
try {
struy = moment().format('YYYY-MM-DD')+"-"+moment().format('hh-mm');
@@ -1349,74 +1348,72 @@ class Listofworks extends Component {
console.log(e);
}
- axios.get((url),{responseType: 'blob'}).then((response) => {
- console.log("1350");
- console.log(response);
- if(response.status&&response.status===-1){
-
-
- }else if(response.status&&response.status===-2){
-
- }else{
- // window.location.href("/api"+url);
- // console.log("开始下载zip文件")
- const type='application/zip'//ZIP文件
- const blob = new Blob([response.data], { type: type })
- const downloadElement = document.createElement('a')
- const href = window.URL.createObjectURL(blob)
- const string = Base64.decode(response.headers['content-disposition'].split('=')[1]);
- console.log(response.headers['content-disposition'].split('=')[1]);
- downloadElement.href = href
- downloadElement.download = string+struy+".zip"
- document.body.appendChild(downloadElement)
- downloadElement.click()
- document.body.removeChild(downloadElement) // 下载完成移除元素
- window.URL.revokeObjectURL(href) // 释放掉blob对象
- }
- }).catch((error) => {
- console.log(error)
- });
- }
- // 课堂学生成绩的导出下载
- Classstudentachievement=(url)=>{
- console.log("Classstudentachievement");
- // console.log();
- var struy="";
- try {
- struy = moment().format('YYYY-MM-DD')+"-"+moment().format('hh-mm');
- struy=struy.replace(/-/g,"");
- }catch (e) {
- console.log(1397);
- console.log(e);
- }
-
-
- axios.get((url),{responseType: 'blob'}).then((response) => {
- console.log("1374");
- console.log(response);
- if(response.status&&response.status===-1){
-
-
- }else if(response.status&&response.status===-2){
-
- }else{
- const type='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' //excel文件
- const blob = new Blob([response.data], { type: type })
- const downloadElement = document.createElement('a')
- const href = window.URL.createObjectURL(blob)
- const string = Base64.decode(response.headers['content-disposition'].split('=')[1]);
- console.log(response.headers['content-disposition'].split('=')[1]);
- downloadElement.href = href
- downloadElement.download =string+struy+".xlsx";
- document.body.appendChild(downloadElement)
- downloadElement.click()
- document.body.removeChild(downloadElement) // 下载完成移除元素
- window.URL.revokeObjectURL(href) // 释放掉blob对象
- }
- }).catch((error) => {
+ axios.get(url).then((response) => {
+ if(response !== undefined){
+ if(response.data.status&&response.data.status===-1){
+ console.log("1352");
+ console.log(response);
+
+ }else if(response.data.status&&response.data.status===-2){
+ console.log("1356");
+ console.log(response);
+ }else {
+ if(type === 1){
+ Internshipreportsy(url,struy,".zip",'application/zip');
+ }else{
+ Internshipreportsy(url,struy,".xlsx",'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
+ }
+ }
+ }
+ }).catch((error) => {
console.log(error)
- });
+ });
}
+ // 导出实习报告批量
+ // internshipreport = (url,struy,types,stingtype)=>{
+ // console.log("internshipreport");
+ //
+ // axios.get((url),{responseType: 'blob'}).then((response) => {
+ // console.log("1350");
+ // console.log(response);
+ // const type='application/zip'//ZIP文件
+ // const blob = new Blob([response.data], { type: stingtype });
+ // const downloadElement = document.createElement('a');
+ // const href = window.URL.createObjectURL(blob);
+ // const string = Base64.decode(response.headers['content-disposition'].split('=')[1]);
+ // console.log(response.headers['content-disposition'].split('=')[1]);
+ // downloadElement.href = href;
+ // downloadElement.download = string+struy+types;
+ // document.body.appendChild(downloadElement);
+ // downloadElement.click();
+ // document.body.removeChild(downloadElement) ;// 下载完成移除元素
+ // window.URL.revokeObjectURL(href) // 释放掉blob对象
+ // }).catch((error) => {
+ // console.log(error)
+ // });
+ // }
+ // // 课堂学生成绩的导出下载
+ // Classstudentachievement=(url,struy)=>{
+ // console.log("Classstudentachievement");
+ // axios.get((url),{responseType: 'blob'}).then((response) => {
+ // console.log("1374");
+ // console.log(response);
+ // const type='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' //excel文件
+ // const blob = new Blob([response.data], { type: type });
+ // const downloadElement = document.createElement('a');
+ // const href = window.URL.createObjectURL(blob);
+ // const string = Base64.decode(response.headers['content-disposition'].split('=')[1]);
+ // console.log(response.headers['content-disposition'].split('=')[1]);
+ // downloadElement.href = href;
+ // downloadElement.download =string+struy+".xlsx";
+ // document.body.appendChild(downloadElement);
+ // downloadElement.click();
+ // document.body.removeChild(downloadElement); // 下载完成移除元素
+ // window.URL.revokeObjectURL(href) // 释放掉blob对象
+ // }).catch((error) => {
+ // console.log(error)
+ // });
+ // }
render() {
// console.log("Listofworks.js000")
@@ -1566,8 +1563,8 @@ class Listofworks extends Component {
{this.props.isAdmin()?
导出
:""}
diff --git a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js
index 3ac1b0bd2..992a957cf 100644
--- a/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js
+++ b/public/react/src/modules/courses/shixunHomework/ShixunStudentWork.js
@@ -459,8 +459,16 @@ class ShixunStudentWork extends Component {
// 导出实习报告批量
internshipreport = (url) => {
console.log("internshipreport");
- // var homeworkid = this.props.match.params.homeworkid;
- // let url = "/zip/shixun_report";
+ console.log("internshipreport");
+ var struy="";
+ try {
+ struy = moment().format('YYYY-MM-DD')+"-"+moment().format('hh-mm');
+ struy=struy.replace(/-/g,"");
+ }catch (e) {
+ console.log(1347);
+ console.log(e);
+ }
+
axios.get(url).then((response) => {
console.log("326");
console.log(response);
@@ -474,19 +482,10 @@ class ShixunStudentWork extends Component {
const blob = new Blob([response.data], { type: type })
const downloadElement = document.createElement('a')
const href = window.URL.createObjectURL(blob)
- //后台再header中传文件名
- // console.log(Base64.decode(response.headers['content-disposition'].split('=')[1]));
const string = Base64.decode(response.headers['content-disposition'].split('=')[1]);
+ console.log(response.headers['content-disposition'].split('=')[1]);
downloadElement.href = href
- var now="";
- try {
- now = moment().year()+""+(moment().month()+1)+""+moment().date()+""+moment().hour()+""+moment().minute()+""
- console.log(now);
-
- } catch (e) {
- console.log("1376");
- }
- downloadElement.download = string+now+".zip"
+ downloadElement.download = string+struy+".zip"
document.body.appendChild(downloadElement)
downloadElement.click()
document.body.removeChild(downloadElement) // 下载完成移除元素
@@ -501,8 +500,16 @@ class ShixunStudentWork extends Component {
// 课堂学生成绩的导出下载
Classstudentachievement = (url) => {
console.log("Classstudentachievement");
- // const course_id = this.props.match.params.coursesId;
- // let url = "/courses/" + course_id + "/export_member_scores_excel.xlsx";
+ // console.log();
+ var struy="";
+ try {
+ struy = moment().format('YYYY-MM-DD')+"-"+moment().format('hh-mm');
+ struy=struy.replace(/-/g,"");
+ }catch (e) {
+ console.log(1397);
+ console.log(e);
+ }
+
axios.get(url).then((response) => {
console.log("1374");
console.log(response);
@@ -516,21 +523,10 @@ class ShixunStudentWork extends Component {
const blob = new Blob([response.data], { type: type })
const downloadElement = document.createElement('a')
const href = window.URL.createObjectURL(blob)
- //后台再header中传文件名
- // console.log("1409");
- // console.log(Base64.decode(response.headers['content-disposition'].split('=')[1]));
const string = Base64.decode(response.headers['content-disposition'].split('=')[1]);
- var now="";
- try {
- now = moment().year()+""+(moment().month()+1)+""+moment().date()+""+moment().hour()+""+moment().minute()+""
- console.log("1422");
- console.log(now);
-
- } catch (e) {
- console.log("1432");
- }
+ console.log(response.headers['content-disposition'].split('=')[1]);
downloadElement.href = href
- downloadElement.download =string+now+".xlsx";
+ downloadElement.download =string+struy+".xlsx";
document.body.appendChild(downloadElement)
downloadElement.click()
document.body.removeChild(downloadElement) // 下载完成移除元素
diff --git a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js
index 9c6ea2421..0d9b4de8f 100644
--- a/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js
+++ b/public/react/src/modules/courses/shixunHomework/ShixunWorkReport.js
@@ -33,40 +33,39 @@ class ShixunWorkReport extends Component {
// 导出实习报告批量
internshipreport = (url) => {
console.log("internshipreport");
- // var homeworkid = this.props.match.params.homeworkid;
- // let url = "/zip/shixun_report";
- axios.get(url).then((response) => {
- console.log("326");
+ var struy="";
+ try {
+ struy = moment().format('YYYY-MM-DD')+"-"+moment().format('hh-mm');
+ struy=struy.replace(/-/g,"");
+ }catch (e) {
+ console.log(1347);
+ console.log(e);
+ }
+
+ axios.get((url),{responseType: 'blob'}).then((response) => {
+ console.log("1350");
console.log(response);
- if(response.data.status&&response.data.status===-1){
+ if(response.status&&response.status===-1){
- }else if(response.data.status&&response.data.status===-2){
+ }else if(response.status&&response.status===-2){
}else{
+ // window.location.href("/api"+url);
+ // console.log("开始下载zip文件")
const type='application/zip'//ZIP文件
const blob = new Blob([response.data], { type: type })
const downloadElement = document.createElement('a')
const href = window.URL.createObjectURL(blob)
- //后台再header中传文件名
- // console.log(Base64.decode(response.headers['content-disposition'].split('=')[1]));
const string = Base64.decode(response.headers['content-disposition'].split('=')[1]);
+ console.log(response.headers['content-disposition'].split('=')[1]);
downloadElement.href = href
- var now="";
- try {
- now = moment().year()+""+(moment().month()+1)+""+moment().date()+""+moment().hour()+""+moment().minute()+""
- console.log(now);
-
- } catch (e) {
- console.log("1376");
- }
- downloadElement.download = string+now+".zip"
+ downloadElement.download = string+struy+".zip"
document.body.appendChild(downloadElement)
downloadElement.click()
document.body.removeChild(downloadElement) // 下载完成移除元素
window.URL.revokeObjectURL(href) // 释放掉blob对象
}
-
}).catch((error) => {
console.log(error)
});
diff --git a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js
index f7f7c80e5..97e8d9aa9 100644
--- a/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js
+++ b/public/react/src/modules/courses/shixunHomework/Trainingjobsetting.js
@@ -1611,88 +1611,84 @@ class Trainingjobsetting extends Component {
}
// 导出实习报告批量
internshipreport = (url) => {
- console.log("internshipreport");
- // var homeworkid = this.props.match.params.homeworkid;
- // let url = "/zip/shixun_report";
- axios.get(url).then((response) => {
- console.log("326");
- console.log(response);
- if(response.data.status&&response.data.status===-1){
-
-
- }else if(response.data.status&&response.data.status===-2){
-
- }else{
- const type='application/zip'//ZIP文件
- const blob = new Blob([response.data], { type: type })
- const downloadElement = document.createElement('a')
- const href = window.URL.createObjectURL(blob)
- //后台再header中传文件名
- // console.log(Base64.decode(response.headers['content-disposition'].split('=')[1]));
- const string = Base64.decode(response.headers['content-disposition'].split('=')[1]);
- downloadElement.href = href
- var now="";
- try {
- now = moment().year()+""+(moment().month()+1)+""+moment().date()+""+moment().hour()+""+moment().minute()+""
- console.log(now);
-
- } catch (e) {
- console.log("1376");
- }
- downloadElement.download = string+now+".zip"
- document.body.appendChild(downloadElement)
- downloadElement.click()
- document.body.removeChild(downloadElement) // 下载完成移除元素
- window.URL.revokeObjectURL(href) // 释放掉blob对象
- }
-
- }).catch((error) => {
- console.log(error)
- });
+ console.log("internshipreport");
+ var struy="";
+ try {
+ struy = moment().format('YYYY-MM-DD')+"-"+moment().format('hh-mm');
+ struy=struy.replace(/-/g,"");
+ }catch (e) {
+ console.log(1347);
+ console.log(e);
+ }
+
+ axios.get((url),{responseType: 'blob'}).then((response) => {
+ console.log("1350");
+ console.log(response);
+ if(response.status&&response.status===-1){
+
+
+ }else if(response.status&&response.status===-2){
+
+ }else{
+ // window.location.href("/api"+url);
+ // console.log("开始下载zip文件")
+ const type='application/zip'//ZIP文件
+ const blob = new Blob([response.data], { type: type })
+ const downloadElement = document.createElement('a')
+ const href = window.URL.createObjectURL(blob)
+ const string = Base64.decode(response.headers['content-disposition'].split('=')[1]);
+ console.log(response.headers['content-disposition'].split('=')[1]);
+ downloadElement.href = href
+ downloadElement.download = string+struy+".zip"
+ document.body.appendChild(downloadElement)
+ downloadElement.click()
+ document.body.removeChild(downloadElement) // 下载完成移除元素
+ window.URL.revokeObjectURL(href) // 释放掉blob对象
+ }
+ }).catch((error) => {
+ console.log(error)
+ });
}
// 课堂学生成绩的导出下载
Classstudentachievement = (url) => {
- console.log("Classstudentachievement");
- // const course_id = this.props.match.params.coursesId;
- // let url = "/courses/" + course_id + "/export_member_scores_excel.xlsx";
- axios.get(url).then((response) => {
- console.log("1374");
- console.log(response);
- if(response.data.status&&response.data.status===-1){
-
-
- }else if(response.data.status&&response.data.status===-2){
-
- }else{
- const type='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' //excel文件
- const blob = new Blob([response.data], { type: type })
- const downloadElement = document.createElement('a')
- const href = window.URL.createObjectURL(blob)
- //后台再header中传文件名
- // console.log("1409");
- // console.log(Base64.decode(response.headers['content-disposition'].split('=')[1]));
- const string = Base64.decode(response.headers['content-disposition'].split('=')[1]);
- var now="";
- try {
- now = moment().year()+""+(moment().month()+1)+""+moment().date()+""+moment().hour()+""+moment().minute()+""
- console.log("1422");
- console.log(now);
-
- } catch (e) {
- console.log("1432");
- }
- downloadElement.href = href
- downloadElement.download =string+now+".xlsx";
- document.body.appendChild(downloadElement)
- downloadElement.click()
- document.body.removeChild(downloadElement) // 下载完成移除元素
- window.URL.revokeObjectURL(href) // 释放掉blob对象
-
- }
- }).catch((error) => {
- console.log(error)
- });
+ console.log("Classstudentachievement");
+ // console.log();
+ var struy="";
+ try {
+ struy = moment().format('YYYY-MM-DD')+"-"+moment().format('hh-mm');
+ struy=struy.replace(/-/g,"");
+ }catch (e) {
+ console.log(1397);
+ console.log(e);
+ }
+
+
+ axios.get((url),{responseType: 'blob'}).then((response) => {
+ console.log("1374");
+ console.log(response);
+ if(response.status&&response.status===-1){
+
+
+ }else if(response.status&&response.status===-2){
+
+ }else{
+ const type='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' //excel文件
+ const blob = new Blob([response.data], { type: type })
+ const downloadElement = document.createElement('a')
+ const href = window.URL.createObjectURL(blob)
+ const string = Base64.decode(response.headers['content-disposition'].split('=')[1]);
+ console.log(response.headers['content-disposition'].split('=')[1]);
+ downloadElement.href = href
+ downloadElement.download =string+struy+".xlsx";
+ document.body.appendChild(downloadElement)
+ downloadElement.click()
+ document.body.removeChild(downloadElement) // 下载完成移除元素
+ window.URL.revokeObjectURL(href) // 释放掉blob对象
+ }
+ }).catch((error) => {
+ console.log(error)
+ });
}
diff --git a/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js b/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js
index 5137351d2..63fa30370 100644
--- a/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js
+++ b/public/react/src/modules/courses/shixunHomework/Workquestionandanswer.js
@@ -323,40 +323,39 @@ class Workquestionandanswer extends Component {
// 导出实习报告批量
internshipreport = (url) => {
console.log("internshipreport");
- // var homeworkid = this.props.match.params.homeworkid;
- // let url = "/zip/shixun_report";
- axios.get(url).then((response) => {
- console.log("326");
+ var struy="";
+ try {
+ struy = moment().format('YYYY-MM-DD')+"-"+moment().format('hh-mm');
+ struy=struy.replace(/-/g,"");
+ }catch (e) {
+ console.log(1347);
+ console.log(e);
+ }
+
+ axios.get((url),{responseType: 'blob'}).then((response) => {
+ console.log("1350");
console.log(response);
- if(response.data.status&&response.data.status===-1){
+ if(response.status&&response.status===-1){
- }else if(response.data.status&&response.data.status===-2){
+ }else if(response.status&&response.status===-2){
}else{
+ // window.location.href("/api"+url);
+ // console.log("开始下载zip文件")
const type='application/zip'//ZIP文件
const blob = new Blob([response.data], { type: type })
const downloadElement = document.createElement('a')
const href = window.URL.createObjectURL(blob)
- //后台再header中传文件名
- // console.log(Base64.decode(response.headers['content-disposition'].split('=')[1]));
const string = Base64.decode(response.headers['content-disposition'].split('=')[1]);
+ console.log(response.headers['content-disposition'].split('=')[1]);
downloadElement.href = href
- var now="";
- try {
- now = moment().year()+""+(moment().month()+1)+""+moment().date()+""+moment().hour()+""+moment().minute()+""
- console.log(now);
-
- } catch (e) {
- console.log("1376");
- }
- downloadElement.download = string+now+".zip"
+ downloadElement.download = string+struy+".zip"
document.body.appendChild(downloadElement)
downloadElement.click()
document.body.removeChild(downloadElement) // 下载完成移除元素
window.URL.revokeObjectURL(href) // 释放掉blob对象
}
-
}).catch((error) => {
console.log(error)
});
@@ -365,41 +364,38 @@ class Workquestionandanswer extends Component {
// 课堂学生成绩的导出下载
Classstudentachievement = (url) => {
console.log("Classstudentachievement");
- // const course_id = this.props.match.params.coursesId;
- // let url = "/courses/" + course_id + "/export_member_scores_excel.xlsx";
- axios.get(url).then((response) => {
+ // console.log();
+ var struy="";
+ try {
+ struy = moment().format('YYYY-MM-DD')+"-"+moment().format('hh-mm');
+ struy=struy.replace(/-/g,"");
+ }catch (e) {
+ console.log(1397);
+ console.log(e);
+ }
+
+
+ axios.get((url),{responseType: 'blob'}).then((response) => {
console.log("1374");
console.log(response);
- if(response.data.status&&response.data.status===-1){
+ if(response.status&&response.status===-1){
- }else if(response.data.status&&response.data.status===-2){
+ }else if(response.status&&response.status===-2){
}else{
const type='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' //excel文件
const blob = new Blob([response.data], { type: type })
const downloadElement = document.createElement('a')
const href = window.URL.createObjectURL(blob)
- //后台再header中传文件名
- // console.log("1409");
- // console.log(Base64.decode(response.headers['content-disposition'].split('=')[1]));
const string = Base64.decode(response.headers['content-disposition'].split('=')[1]);
- var now="";
- try {
- now = moment().year()+""+(moment().month()+1)+""+moment().date()+""+moment().hour()+""+moment().minute()+""
- console.log("1422");
- console.log(now);
-
- } catch (e) {
- console.log("1432");
- }
+ console.log(response.headers['content-disposition'].split('=')[1]);
downloadElement.href = href
- downloadElement.download =string+now+".xlsx";
+ downloadElement.download =string+struy+".xlsx";
document.body.appendChild(downloadElement)
downloadElement.click()
document.body.removeChild(downloadElement) // 下载完成移除元素
window.URL.revokeObjectURL(href) // 释放掉blob对象
-
}
}).catch((error) => {
console.log(error)
diff --git a/public/react/src/modules/login/EducoderLogin.js b/public/react/src/modules/login/EducoderLogin.js
index 10d792aa2..7d9a0be9d 100644
--- a/public/react/src/modules/login/EducoderLogin.js
+++ b/public/react/src/modules/login/EducoderLogin.js
@@ -62,6 +62,8 @@ class EducoderLogin extends Component {
this.state = {
showbool: 3,
logini:3,
+ namezh:"",
+ passmm:""
}
}else {
if(props.match.url === "/login"){
@@ -69,6 +71,8 @@ class EducoderLogin extends Component {
showbool: 1,
loginstatus:true,
logini:1,
+ namezh:"",
+ passmm:""
}
}else if(props.match.url === "/register"){
@@ -76,11 +80,15 @@ class EducoderLogin extends Component {
showbool: 1,
loginstatus:false,
logini:2,
+ namezh:"",
+ passmm:""
}
}else{
this.state = {
showbool: 1,
logini:1,
+ namezh:"",
+ passmm:""
}
}
@@ -101,14 +109,16 @@ class EducoderLogin extends Component {
})
}
- Setshowbool = (e) => {
+ Setshowbool = (e,name,pass) => {
if (e===1) {
this.setState({
showbool: 1
})
} else if(e===2) {
this.setState({
- showbool: 2
+ showbool: 2,
+ namezh:name,
+ passmm:pass,
})
}else if(e===3){
this.setState({
diff --git a/public/react/src/modules/user/Interestpage.js b/public/react/src/modules/user/Interestpage.js
index 0d01ab563..d058d5881 100644
--- a/public/react/src/modules/user/Interestpage.js
+++ b/public/react/src/modules/user/Interestpage.js
@@ -25,6 +25,8 @@ class InterestpageComponent extends Component {
gouxuans: 0,
gouxuans2:0,
gouxuans3:[{id:1,name:"前端开发",bool:false,url:qdkf},{id:2,name:"后端开发",bool:false,url:hdkf},{id:3,name:"移动开发",bool:false,url:ydkf},{id:4,name:"数据库",bool:false,url:sjk},{id:5,name:"云计算和大数据",bool:false,url:ysj},{id:6,name:"运维与测试",bool:false,url:yunwei},{id:7,name:"人工智能",bool:false,url:rgzn},{id:8,name:"其他",bool:false,url:qita}],
+ namezh:this.props.namezh,
+ passmm:this.props.passmm,
}
}
Clickteacher=(e)=>{
@@ -63,6 +65,33 @@ class InterestpageComponent extends Component {
})
}
+ //跳转然后登入
+ Jumptotheinterestpage=(username,password)=>{
+ var url = "/accounts/login.json";
+ axios.post(url, {
+ login: username,
+ password: password,
+ }).then((response) => {
+ if (response === undefined) {
+ return
+ }
+ if (response.status === 200) {
+ if (response.data.status === 402) {
+ window.location.href = response.data.url;
+ } else {
+ this.setState({
+ isRender: false
+ })
+ window.location.href = "/"
+
+ }
+ }
+
+
+ }).catch((error) => {
+
+ })
+ }
render() {
const {
gouxuans,
diff --git a/public/react/src/modules/user/LoginRegisterComponent.js b/public/react/src/modules/user/LoginRegisterComponent.js
index 54185c9ed..5b8fc025b 100644
--- a/public/react/src/modules/user/LoginRegisterComponent.js
+++ b/public/react/src/modules/user/LoginRegisterComponent.js
@@ -344,8 +344,8 @@ class LoginRegisterComponent extends Component {
passwords: "",
Agreetotheterms: "",
})
- this.props.history.push(result.data.redirect_uri);
- //this.props.Setshowbool(2);
+ // this.props.history.push(result.data.redirect_uri);
+ this.props.Setshowbool(2,this.state.logins,this.state.passwords);
} catch (e) {
}
@@ -662,7 +662,7 @@ class LoginRegisterComponent extends Component {