dev_forum
杨树林 5 years ago
parent f102b5a8ad
commit 96970811d4

@ -1336,10 +1336,8 @@ class Listofworks extends Component {
}); });
} }
/// 确认是否下砸
// 导出实习报告批量 confirmysl(url,type){
internshipreport = (url)=>{
console.log("internshipreport");
var struy=""; var struy="";
try { try {
struy = moment().format('YYYY-MM-DD')+"-"+moment().format('hh-mm'); struy = moment().format('YYYY-MM-DD')+"-"+moment().format('hh-mm');
@ -1349,70 +1347,66 @@ class Listofworks extends Component {
console.log(e); console.log(e);
} }
axios.get((url),{responseType: 'blob'}).then((response) => { axios.get(url).then((response) => {
console.log("1350"); if(response.data.status&&response.data.status===-1){
console.log(response); console.log("1352");
if(response.status&&response.status===-1){ console.log(response);
}else if(response.status&&response.status===-2){ }else if(response.data.status&&response.data.status===-2){
console.log("1356");
console.log(response);
}else {
if(type === 1){
this.internshipreport(url,struy)
}else{
this.Classstudentachievement(url,struy);
}
}
}).catch((error) => {
console.log(error)
});
}
// 导出实习报告批量
internshipreport = (url,struy)=>{
console.log("internshipreport");
}else{ axios.get((url),{responseType: 'blob'}).then((response) => {
// window.location.href("/api"+url); console.log("1350");
// console.log("开始下载zip文件") console.log(response);
const type='application/zip'//ZIP文件 const type='application/zip'//ZIP文件
const blob = new Blob([response.data], { type: type }) const blob = new Blob([response.data], { type: type });
const downloadElement = document.createElement('a') const downloadElement = document.createElement('a');
const href = window.URL.createObjectURL(blob) const href = window.URL.createObjectURL(blob);
const string = 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]); console.log(response.headers['content-disposition'].split('=')[1]);
downloadElement.href = href downloadElement.href = href;
downloadElement.download = string+struy+".zip" downloadElement.download = string+struy+".zip";
document.body.appendChild(downloadElement) document.body.appendChild(downloadElement);
downloadElement.click() downloadElement.click();
document.body.removeChild(downloadElement) // 下载完成移除元素 document.body.removeChild(downloadElement) ;// 下载完成移除元素
window.URL.revokeObjectURL(href) // 释放掉blob对象 window.URL.revokeObjectURL(href) // 释放掉blob对象
}
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
}); });
} }
// 课堂学生成绩的导出下载 // 课堂学生成绩的导出下载
Classstudentachievement=(url)=>{ Classstudentachievement=(url,struy)=>{
console.log("Classstudentachievement"); 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) => { axios.get((url),{responseType: 'blob'}).then((response) => {
console.log("1374"); console.log("1374");
console.log(response); 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 type='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' //excel文件
const blob = new Blob([response.data], { type: type }) const blob = new Blob([response.data], { type: type });
const downloadElement = document.createElement('a') const downloadElement = document.createElement('a');
const href = window.URL.createObjectURL(blob) const href = window.URL.createObjectURL(blob);
const string = 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]); console.log(response.headers['content-disposition'].split('=')[1]);
downloadElement.href = href downloadElement.href = href;
downloadElement.download =string+struy+".xlsx"; downloadElement.download =string+struy+".xlsx";
document.body.appendChild(downloadElement) document.body.appendChild(downloadElement);
downloadElement.click() downloadElement.click();
document.body.removeChild(downloadElement) // 下载完成移除元素 document.body.removeChild(downloadElement); // 下载完成移除元素
window.URL.revokeObjectURL(href) // 释放掉blob对象 window.URL.revokeObjectURL(href) // 释放掉blob对象
}
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
}); });
@ -1566,8 +1560,8 @@ class Listofworks extends Component {
{this.props.isAdmin()? <li className="li_line drop_down fr color-blue font-16 mr8 mt20" style={{"padding":"0 20px"}}> {this.props.isAdmin()? <li className="li_line drop_down fr color-blue font-16 mr8 mt20" style={{"padding":"0 20px"}}>
导出<i className="iconfont icon-xiajiantou font-12 ml2"></i> 导出<i className="iconfont icon-xiajiantou font-12 ml2"></i>
<ul className="drop_down_menu" style={{"right":"-0px","left":"unset","height":"auto"}}> <ul className="drop_down_menu" style={{"right":"-0px","left":"unset","height":"auto"}}>
<li><a onClick={()=>this.internshipreport(`/zip/shixun_report?homework_common_id=${this.props.match.params.homeworkid}&work_status=${this.state.course_groupyslstwo}&course_group=${this.state.checkedValuesineinfo}&search=${this.state.searchtext}`)}>实训报告</a></li> <li><a onClick={()=>this.confirmysl(`/zip/shixun_report?homework_common_id=${this.props.match.params.homeworkid}&work_status=${this.state.course_groupyslstwo}&course_group=${this.state.checkedValuesineinfo}&search=${this.state.searchtext}`,1)}>实训报告</a></li>
<li><a onClick={()=>this.Classstudentachievement(`/homework_commons/${this.props.match.params.homeworkid}/works_list.xlsx?group_id=${this.state.checkedValuesineinfo}&search=${this.state.searchtext}`)} >学生成绩</a></li> <li><a onClick={()=>this.confirmysl(`/homework_commons/${this.props.match.params.homeworkid}/works_list.xlsx?group_id=${this.state.checkedValuesineinfo}&search=${this.state.searchtext}`,2)} >学生成绩</a></li>
</ul> </ul>
</li>:""} </li>:""}

@ -459,8 +459,16 @@ class ShixunStudentWork extends Component {
// 导出实习报告批量 // 导出实习报告批量
internshipreport = (url) => { internshipreport = (url) => {
console.log("internshipreport"); console.log("internshipreport");
// var homeworkid = this.props.match.params.homeworkid; console.log("internshipreport");
// let url = "/zip/shixun_report"; 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) => { axios.get(url).then((response) => {
console.log("326"); console.log("326");
console.log(response); console.log(response);
@ -474,19 +482,10 @@ class ShixunStudentWork extends Component {
const blob = new Blob([response.data], { type: type }) const blob = new Blob([response.data], { type: type })
const downloadElement = document.createElement('a') const downloadElement = document.createElement('a')
const href = window.URL.createObjectURL(blob) 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]); const string = Base64.decode(response.headers['content-disposition'].split('=')[1]);
console.log(response.headers['content-disposition'].split('=')[1]);
downloadElement.href = href downloadElement.href = href
var now=""; downloadElement.download = string+struy+".zip"
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) document.body.appendChild(downloadElement)
downloadElement.click() downloadElement.click()
document.body.removeChild(downloadElement) // 下载完成移除元素 document.body.removeChild(downloadElement) // 下载完成移除元素
@ -501,8 +500,16 @@ class ShixunStudentWork extends Component {
// 课堂学生成绩的导出下载 // 课堂学生成绩的导出下载
Classstudentachievement = (url) => { Classstudentachievement = (url) => {
console.log("Classstudentachievement"); console.log("Classstudentachievement");
// const course_id = this.props.match.params.coursesId; // console.log();
// let url = "/courses/" + course_id + "/export_member_scores_excel.xlsx"; 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) => { axios.get(url).then((response) => {
console.log("1374"); console.log("1374");
console.log(response); console.log(response);
@ -516,21 +523,10 @@ class ShixunStudentWork extends Component {
const blob = new Blob([response.data], { type: type }) const blob = new Blob([response.data], { type: type })
const downloadElement = document.createElement('a') const downloadElement = document.createElement('a')
const href = window.URL.createObjectURL(blob) 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]); const string = Base64.decode(response.headers['content-disposition'].split('=')[1]);
var now=""; console.log(response.headers['content-disposition'].split('=')[1]);
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.href = href
downloadElement.download =string+now+".xlsx"; downloadElement.download =string+struy+".xlsx";
document.body.appendChild(downloadElement) document.body.appendChild(downloadElement)
downloadElement.click() downloadElement.click()
document.body.removeChild(downloadElement) // 下载完成移除元素 document.body.removeChild(downloadElement) // 下载完成移除元素

@ -33,40 +33,39 @@ class ShixunWorkReport extends Component {
// 导出实习报告批量 // 导出实习报告批量
internshipreport = (url) => { internshipreport = (url) => {
console.log("internshipreport"); console.log("internshipreport");
// var homeworkid = this.props.match.params.homeworkid; var struy="";
// let url = "/zip/shixun_report"; try {
axios.get(url).then((response) => { struy = moment().format('YYYY-MM-DD')+"-"+moment().format('hh-mm');
console.log("326"); 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); 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{ }else{
// window.location.href("/api"+url);
// console.log("开始下载zip文件")
const type='application/zip'//ZIP文件 const type='application/zip'//ZIP文件
const blob = new Blob([response.data], { type: type }) const blob = new Blob([response.data], { type: type })
const downloadElement = document.createElement('a') const downloadElement = document.createElement('a')
const href = window.URL.createObjectURL(blob) 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]); const string = Base64.decode(response.headers['content-disposition'].split('=')[1]);
console.log(response.headers['content-disposition'].split('=')[1]);
downloadElement.href = href downloadElement.href = href
var now=""; downloadElement.download = string+struy+".zip"
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) document.body.appendChild(downloadElement)
downloadElement.click() downloadElement.click()
document.body.removeChild(downloadElement) // 下载完成移除元素 document.body.removeChild(downloadElement) // 下载完成移除元素
window.URL.revokeObjectURL(href) // 释放掉blob对象 window.URL.revokeObjectURL(href) // 释放掉blob对象
} }
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
}); });

@ -1611,88 +1611,84 @@ class Trainingjobsetting extends Component {
} }
// 导出实习报告批量 // 导出实习报告批量
internshipreport = (url) => { internshipreport = (url) => {
console.log("internshipreport"); console.log("internshipreport");
// var homeworkid = this.props.match.params.homeworkid; var struy="";
// let url = "/zip/shixun_report"; try {
axios.get(url).then((response) => { struy = moment().format('YYYY-MM-DD')+"-"+moment().format('hh-mm');
console.log("326"); struy=struy.replace(/-/g,"");
console.log(response); }catch (e) {
if(response.data.status&&response.data.status===-1){ console.log(1347);
console.log(e);
}
}else if(response.data.status&&response.data.status===-2){
axios.get((url),{responseType: 'blob'}).then((response) => {
}else{ console.log("1350");
const type='application/zip'//ZIP文件 console.log(response);
const blob = new Blob([response.data], { type: type }) if(response.status&&response.status===-1){
const downloadElement = document.createElement('a')
const href = window.URL.createObjectURL(blob)
//后台再header中传文件名 }else if(response.status&&response.status===-2){
// console.log(Base64.decode(response.headers['content-disposition'].split('=')[1]));
const string = Base64.decode(response.headers['content-disposition'].split('=')[1]); }else{
downloadElement.href = href // window.location.href("/api"+url);
var now=""; // console.log("开始下载zip文件")
try { const type='application/zip'//ZIP文件
now = moment().year()+""+(moment().month()+1)+""+moment().date()+""+moment().hour()+""+moment().minute()+"" const blob = new Blob([response.data], { type: type })
console.log(now); const downloadElement = document.createElement('a')
const href = window.URL.createObjectURL(blob)
} catch (e) { const string = Base64.decode(response.headers['content-disposition'].split('=')[1]);
console.log("1376"); console.log(response.headers['content-disposition'].split('=')[1]);
} downloadElement.href = href
downloadElement.download = string+now+".zip" downloadElement.download = string+struy+".zip"
document.body.appendChild(downloadElement) document.body.appendChild(downloadElement)
downloadElement.click() downloadElement.click()
document.body.removeChild(downloadElement) // 下载完成移除元素 document.body.removeChild(downloadElement) // 下载完成移除元素
window.URL.revokeObjectURL(href) // 释放掉blob对象 window.URL.revokeObjectURL(href) // 释放掉blob对象
} }
}).catch((error) => {
}).catch((error) => { console.log(error)
console.log(error) });
});
} }
// 课堂学生成绩的导出下载 // 课堂学生成绩的导出下载
Classstudentachievement = (url) => { Classstudentachievement = (url) => {
console.log("Classstudentachievement"); console.log("Classstudentachievement");
// const course_id = this.props.match.params.coursesId; // console.log();
// let url = "/courses/" + course_id + "/export_member_scores_excel.xlsx"; var struy="";
axios.get(url).then((response) => { try {
console.log("1374"); struy = moment().format('YYYY-MM-DD')+"-"+moment().format('hh-mm');
console.log(response); struy=struy.replace(/-/g,"");
if(response.data.status&&response.data.status===-1){ }catch (e) {
console.log(1397);
console.log(e);
}else if(response.data.status&&response.data.status===-2){ }
}else{
const type='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' //excel文件 axios.get((url),{responseType: 'blob'}).then((response) => {
const blob = new Blob([response.data], { type: type }) console.log("1374");
const downloadElement = document.createElement('a') console.log(response);
const href = window.URL.createObjectURL(blob) if(response.status&&response.status===-1){
//后台再header中传文件名
// console.log("1409");
// console.log(Base64.decode(response.headers['content-disposition'].split('=')[1])); }else if(response.status&&response.status===-2){
const string = Base64.decode(response.headers['content-disposition'].split('=')[1]);
var now=""; }else{
try { const type='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' //excel文件
now = moment().year()+""+(moment().month()+1)+""+moment().date()+""+moment().hour()+""+moment().minute()+"" const blob = new Blob([response.data], { type: type })
console.log("1422"); const downloadElement = document.createElement('a')
console.log(now); const href = window.URL.createObjectURL(blob)
const string = Base64.decode(response.headers['content-disposition'].split('=')[1]);
} catch (e) { console.log(response.headers['content-disposition'].split('=')[1]);
console.log("1432"); downloadElement.href = href
} downloadElement.download =string+struy+".xlsx";
downloadElement.href = href document.body.appendChild(downloadElement)
downloadElement.download =string+now+".xlsx"; downloadElement.click()
document.body.appendChild(downloadElement) document.body.removeChild(downloadElement) // 下载完成移除元素
downloadElement.click() window.URL.revokeObjectURL(href) // 释放掉blob对象
document.body.removeChild(downloadElement) // 下载完成移除元素 }
window.URL.revokeObjectURL(href) // 释放掉blob对象 }).catch((error) => {
console.log(error)
} });
}).catch((error) => {
console.log(error)
});
} }

@ -323,40 +323,39 @@ class Workquestionandanswer extends Component {
// 导出实习报告批量 // 导出实习报告批量
internshipreport = (url) => { internshipreport = (url) => {
console.log("internshipreport"); console.log("internshipreport");
// var homeworkid = this.props.match.params.homeworkid; var struy="";
// let url = "/zip/shixun_report"; try {
axios.get(url).then((response) => { struy = moment().format('YYYY-MM-DD')+"-"+moment().format('hh-mm');
console.log("326"); 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); 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{ }else{
// window.location.href("/api"+url);
// console.log("开始下载zip文件")
const type='application/zip'//ZIP文件 const type='application/zip'//ZIP文件
const blob = new Blob([response.data], { type: type }) const blob = new Blob([response.data], { type: type })
const downloadElement = document.createElement('a') const downloadElement = document.createElement('a')
const href = window.URL.createObjectURL(blob) 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]); const string = Base64.decode(response.headers['content-disposition'].split('=')[1]);
console.log(response.headers['content-disposition'].split('=')[1]);
downloadElement.href = href downloadElement.href = href
var now=""; downloadElement.download = string+struy+".zip"
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) document.body.appendChild(downloadElement)
downloadElement.click() downloadElement.click()
document.body.removeChild(downloadElement) // 下载完成移除元素 document.body.removeChild(downloadElement) // 下载完成移除元素
window.URL.revokeObjectURL(href) // 释放掉blob对象 window.URL.revokeObjectURL(href) // 释放掉blob对象
} }
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
}); });
@ -365,41 +364,38 @@ class Workquestionandanswer extends Component {
// 课堂学生成绩的导出下载 // 课堂学生成绩的导出下载
Classstudentachievement = (url) => { Classstudentachievement = (url) => {
console.log("Classstudentachievement"); console.log("Classstudentachievement");
// const course_id = this.props.match.params.coursesId; // console.log();
// let url = "/courses/" + course_id + "/export_member_scores_excel.xlsx"; var struy="";
axios.get(url).then((response) => { 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("1374");
console.log(response); 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{ }else{
const type='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' //excel文件 const type='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' //excel文件
const blob = new Blob([response.data], { type: type }) const blob = new Blob([response.data], { type: type })
const downloadElement = document.createElement('a') const downloadElement = document.createElement('a')
const href = window.URL.createObjectURL(blob) 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]); const string = Base64.decode(response.headers['content-disposition'].split('=')[1]);
var now=""; console.log(response.headers['content-disposition'].split('=')[1]);
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.href = href
downloadElement.download =string+now+".xlsx"; downloadElement.download =string+struy+".xlsx";
document.body.appendChild(downloadElement) document.body.appendChild(downloadElement)
downloadElement.click() downloadElement.click()
document.body.removeChild(downloadElement) // 下载完成移除元素 document.body.removeChild(downloadElement) // 下载完成移除元素
window.URL.revokeObjectURL(href) // 释放掉blob对象 window.URL.revokeObjectURL(href) // 释放掉blob对象
} }
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)

@ -62,6 +62,8 @@ class EducoderLogin extends Component {
this.state = { this.state = {
showbool: 3, showbool: 3,
logini:3, logini:3,
namezh:"",
passmm:""
} }
}else { }else {
if(props.match.url === "/login"){ if(props.match.url === "/login"){
@ -69,6 +71,8 @@ class EducoderLogin extends Component {
showbool: 1, showbool: 1,
loginstatus:true, loginstatus:true,
logini:1, logini:1,
namezh:"",
passmm:""
} }
}else if(props.match.url === "/register"){ }else if(props.match.url === "/register"){
@ -76,11 +80,15 @@ class EducoderLogin extends Component {
showbool: 1, showbool: 1,
loginstatus:false, loginstatus:false,
logini:2, logini:2,
namezh:"",
passmm:""
} }
}else{ }else{
this.state = { this.state = {
showbool: 1, showbool: 1,
logini:1, logini:1,
namezh:"",
passmm:""
} }
} }
@ -101,14 +109,16 @@ class EducoderLogin extends Component {
}) })
} }
Setshowbool = (e) => { Setshowbool = (e,name,pass) => {
if (e===1) { if (e===1) {
this.setState({ this.setState({
showbool: 1 showbool: 1
}) })
} else if(e===2) { } else if(e===2) {
this.setState({ this.setState({
showbool: 2 showbool: 2,
namezh:name,
passmm:pass,
}) })
}else if(e===3){ }else if(e===3){
this.setState({ this.setState({

@ -25,6 +25,8 @@ class InterestpageComponent extends Component {
gouxuans: 0, gouxuans: 0,
gouxuans2: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}], 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)=>{ Clickteacher=(e)=>{
@ -63,6 +65,34 @@ 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 {
broadcastChannelPostMessage('refreshPage')
this.setState({
isRender: false
})
window.location.href = "/"
}
}
}).catch((error) => {
})
}
render() { render() {
const { const {
gouxuans, gouxuans,

@ -344,8 +344,8 @@ class LoginRegisterComponent extends Component {
passwords: "", passwords: "",
Agreetotheterms: "", Agreetotheterms: "",
}) })
this.props.history.push(result.data.redirect_uri); // this.props.history.push(result.data.redirect_uri);
//this.props.Setshowbool(2); this.props.Setshowbool(2,this.state.logins,this.state.passwords);
} catch (e) { } catch (e) {
} }
@ -662,7 +662,7 @@ class LoginRegisterComponent extends Component {
<div className="left_right mt25 font-12 " style={{color: '#676767'}}> <div className="left_right mt25 font-12 " style={{color: '#676767'}}>
<Checkbox onChange={this.onAutoLoginChange} checked={autoLogin}>下次自动登录</Checkbox> <Checkbox onChange={this.onAutoLoginChange} checked={autoLogin}>下次自动登录</Checkbox>
<a onClick={this.StudyMakeMoney} <a onClick={()=>this.StudyMakeMoney()}
className="mr3 color-grey-9 mt3 font-12">找回密码</a> className="mr3 color-grey-9 mt3 font-12">找回密码</a>
</div> </div>

Loading…
Cancel
Save