dev_forum
杨树林 5 years ago
parent 8c97955ab6
commit 8b99e0f41e

@ -112,10 +112,17 @@ class Testpapersettinghomepage extends Component{
experiment=(url)=>{ experiment=(url)=>{
axios.get(url).then((response) => { axios.get(url).then((response) => {
if(response.status === 200){ if(response.data.status&&response.data.status===-1){
window.open(url, '_blank');
}else if(response.data.status&&response.data.status===-2){
} if(response.data.messages === "100"){
// 已超出文件导出的上限数量100 ),建议:
}else {
//因附件资料超过500M
}
}else {
window.open(url, '_blank');
}
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
}); });
@ -262,7 +269,7 @@ class Testpapersettinghomepage extends Component{
导出<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":"-34px","left":"unset","height":"auto"}}> <ul className="drop_down_menu" style={{"right":"-34px","left":"unset","height":"auto"}}>
<li><a onClick={()=>this.experiment(`/api/exercises/${this.props.match.params.Id}/exercise_lists.xlsx`)}>学生成绩</a></li> <li><a onClick={()=>this.experiment(`/api/exercises/${this.props.match.params.Id}/exercise_lists.xlsx`)}>学生成绩</a></li>
<li><a href={`/api/exercises/${this.props.match.params.Id}/export_exercise`} >空白试卷</a></li> <li><a onClick={()=>this.experiment(`/api/exercises/${this.props.match.params.Id}/export_exercise`)} >空白试卷</a></li>
<li><a onClick={()=>this.experiment(`/api/zip/export_exercises?exercise_id=${this.props.match.params.Id}${this.state.groupyslsval}`)}>学生答题试卷</a></li> <li><a onClick={()=>this.experiment(`/api/zip/export_exercises?exercise_id=${this.props.match.params.Id}${this.state.groupyslsval}`)}>学生答题试卷</a></li>
</ul> </ul>
</li>:""} </li>:""}

@ -3,7 +3,8 @@ import axios from 'axios';
// 导出实习报告批量zip 、xlsx 类型 // 导出实习报告批量zip 、xlsx 类型
export function Internshipreportsy (url,struy,types,stingtype,response){ export function Internshipreportsy (url,struy,types,stingtype){
axios.get((url),{responseType: 'blob'}).then((response) => {
const blob = new Blob([response.data], { type: stingtype }); const blob = new Blob([response.data], { type: stingtype });
const downloadElement = document.createElement('a'); const downloadElement = document.createElement('a');
const href = window.URL.createObjectURL(blob); const href = window.URL.createObjectURL(blob);
@ -14,4 +15,7 @@ export function Internshipreportsy (url,struy,types,stingtype,response){
downloadElement.click(); downloadElement.click();
document.body.removeChild(downloadElement) ;// 下载完成移除元素 document.body.removeChild(downloadElement) ;// 下载完成移除元素
window.URL.revokeObjectURL(href) // 释放掉blob对象 window.URL.revokeObjectURL(href) // 释放掉blob对象
}).catch((error) => {
console.log(error)
});
} }

@ -1338,80 +1338,23 @@ class Listofworks extends Component {
} }
/// 确认是否下载 /// 确认是否下载
confirmysl(url,type){ confirmysl(url){
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) => {
if(response !== undefined){ if(response.data.status&&response.data.status===-1){
if(response.data.status&&response.data.status===-1){
}else if(response.data.status&&response.data.status===-2){
}else if(response.data.status&&response.data.status===-2){ if(response.data.messages === "100"){
// 已超出文件导出的上限数量100 ),建议:
}else { }else {
// if(type === 1){ //因附件资料超过500M
// Internshipreportsy(url,struy,".zip",'application/zip'); }
// }else{ }else {
Internshipreportsy(url,struy,".xlsx",'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',response); window.open(url, '_blank');
// } }
} }).catch((error) => {
}
}).catch((error) => {
console.log(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() { render() {
// console.log("Listofworks.js000") // console.log("Listofworks.js000")
@ -1560,8 +1503,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.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.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}`)}>实训报告</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> <li><a onClick={()=>this.confirmysl(`/homework_commons/${this.props.match.params.homeworkid}/works_list.xlsx?group_id=${this.state.checkedValuesineinfo}&search=${this.state.searchtext}`)} >学生成绩</a></li>
</ul> </ul>
</li>:""} </li>:""}

@ -457,86 +457,25 @@ class ShixunStudentWork extends Component {
}) })
} }
// 导出实习报告批量 // 导出实习报告批量
internshipreport = (url) => { /// 确认是否下载
console.log("internshipreport"); confirmysl(url){
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) => { axios.get(url).then((response) => {
console.log("326");
console.log(response);
if(response.data.status&&response.data.status===-1){ if(response.data.status&&response.data.status===-1){
}else if(response.data.status&&response.data.status===-2){ }else if(response.data.status&&response.data.status===-2){
if(response.data.messages === "100"){
}else{ // 已超出文件导出的上限数量100 ),建议:
const type='application/zip'//ZIP文件 }else {
const blob = new Blob([response.data], { type: type }) //因附件资料超过500M
const downloadElement = document.createElement('a') }
const href = window.URL.createObjectURL(blob) }else {
const string = Base64.decode(response.headers['content-disposition'].split('=')[1]); window.open(url, '_blank');
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) => { }).catch((error) => {
console.log(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).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)
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() { render() {
let { let {
@ -722,9 +661,9 @@ class ShixunStudentWork 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}`)}>实训报告</a> <li><a onClick={()=>this.confirmysl(`/zip/shixun_report?homework_common_id=${this.props.match.params.homeworkid}`)}>实训报告</a>
</li> </li>
<li><a onClick={()=>this.Classstudentachievement(`/homework_commons/${this.props.match.params.homeworkid}/works_list.xlsx`)}>学生成绩</a> <li><a onClick={()=>this.confirmysl(`/homework_commons/${this.props.match.params.homeworkid}/works_list.xlsx`)}>学生成绩</a>
</li> </li>
</ul> </ul>
</li> : ""} </li> : ""}

@ -30,46 +30,26 @@ class ShixunWorkReport extends Component {
spinning:true spinning:true
} }
} }
// 导出实习报告批量 /// 确认是否下载
internshipreport = (url) => { confirmysl(url){
console.log("internshipreport"); axios.get(url).then((response) => {
var struy=""; if(response.data.status&&response.data.status===-1){
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 if(response.data.status&&response.data.status===-2){
if(response.data.messages === "100"){
}else{ // 已超出文件导出的上限数量100 ),建议:
// window.location.href("/api"+url); }else {
// console.log("开始下载zip文件") //因附件资料超过500M
const type='application/zip'//ZIP文件 }
const blob = new Blob([response.data], { type: type }) }else {
const downloadElement = document.createElement('a') window.open(url, '_blank');
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) => { }).catch((error) => {
console.log(error) console.log(error)
}); });
} }
componentDidMount() { componentDidMount() {
this.setState({ this.setState({
spinning:true spinning:true
@ -134,7 +114,7 @@ class ShixunWorkReport extends Component {
{/*{this.props.isAdmin()?<a className=" fr font-14 ml30 mt10 mr20 color-grey-9 ">导出实训报告数据</a>:""}*/} {/*{this.props.isAdmin()?<a className=" fr font-14 ml30 mt10 mr20 color-grey-9 ">导出实训报告数据</a>:""}*/}
{this.props.isAdmin() ? <a {this.props.isAdmin() ? <a
className="fr color-blue font-16" className="fr color-blue font-16"
onClick={()=>this.internshipreport(`/zip/shixun_report?homework_common_id=${homeworkid}`)} onClick={()=>this.confirmysl(`/zip/shixun_report?homework_common_id=${homeworkid}`)}
>导出实训报告数据</a> : ""} >导出实训报告数据</a> : ""}
</div> </div>

@ -1609,86 +1609,24 @@ class Trainingjobsetting extends Component {
showmodel:false showmodel:false
}) })
} }
// 导出实习报告批量
internshipreport = (url) => {
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) => { confirmysl(url){
console.log("Classstudentachievement"); axios.get(url).then((response) => {
// console.log(); if(response.data.status&&response.data.status===-1){
var struy="";
try { }else if(response.data.status&&response.data.status===-2){
struy = moment().format('YYYY-MM-DD')+"-"+moment().format('hh-mm'); if(response.data.messages === "100"){
struy=struy.replace(/-/g,""); // 已超出文件导出的上限数量100 ),建议:
}catch (e) { }else {
console.log(1397); //因附件资料超过500M
console.log(e); }
} }else {
window.open(url, '_blank');
}
axios.get((url),{responseType: 'blob'}).then((response) => { }).catch((error) => {
console.log("1374"); console.log(error)
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)
});
} }
@ -1831,9 +1769,9 @@ class Trainingjobsetting 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}`)}>实训报告</a> <li><a onClick={()=>this.confirmysl(`/zip/shixun_report?homework_common_id=${this.props.match.params.homeworkid}`)}>实训报告</a>
</li> </li>
<li><a onClick={()=>this.Classstudentachievement(`/homework_commons/${this.props.match.params.homeworkid}/works_list.xlsx`)}>学生成绩</a> <li><a onClick={()=>this.confirmysl(`/homework_commons/${this.props.match.params.homeworkid}/works_list.xlsx`)}>学生成绩</a>
</li> </li>
</ul> </ul>
</li>: ""} </li>: ""}

@ -319,83 +319,19 @@ class Workquestionandanswer extends Component {
}) })
} }
/// 确认是否下载
confirmysl(url){
axios.get(url).then((response) => {
if(response.data.status&&response.data.status===-1){
// 导出实习报告批量 }else if(response.data.status&&response.data.status===-2){
internshipreport = (url) => { if(response.data.messages === "100"){
console.log("internshipreport"); // 已超出文件导出的上限数量100 ),建议:
var struy=""; }else {
try { //因附件资料超过500M
struy = moment().format('YYYY-MM-DD')+"-"+moment().format('hh-mm'); }
struy=struy.replace(/-/g,""); }else {
}catch (e) { window.open(url, '_blank');
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");
// 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) => { }).catch((error) => {
console.log(error) console.log(error)
@ -527,9 +463,9 @@ class Workquestionandanswer extends Component {
<li className="li_line drop_down fr color-blue font-16 mr8 mt20" style={{"padding": "0 20px"}}> <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}`)}>实训报告</a> <li><a onClick={()=>this.confirmysl(`/zip/shixun_report?homework_common_id=${this.props.match.params.homeworkid}`)}>实训报告</a>
</li> </li>
<li><a onClick={()=>this.Classstudentachievement(`/homework_commons/${this.props.match.params.homeworkid}/works_list.xlsx`)}>学生成绩</a> <li><a onClick={()=>this.confirmysl(`/homework_commons/${this.props.match.params.homeworkid}/works_list.xlsx`)}>学生成绩</a>
</li> </li>
</ul> </ul>
</li> : ""} </li> : ""}

@ -165,7 +165,7 @@ class EducoderLogin extends Component {
<div style={{"margin-top": "40px","height":"580px"}}> <div style={{"margin-top": "40px","height":"580px"}}>
<LoginRegisterComponent {...this.props} {...this.state} <LoginRegisterComponent {...this.props} {...this.state}
Setshowbool={(e)=>this.Setshowbool(e)} ></LoginRegisterComponent> Setshowbool={(e)=>this.Setshowbool(e,name,pass)} ></LoginRegisterComponent>
</div> </div>

@ -31,6 +31,42 @@ class InterestpageComponent extends Component {
passmm:this.props.passmm, passmm:this.props.passmm,
} }
} }
componentWillReceiveProps(nextProps) {
// console.log("46");
// console.log(nextProps);
// console.log(this.props);
if (nextProps.namezh != this.props.namezh) {
// console.log("50");
// console.log(nextProps.user);
if (nextProps.namezh !== undefined) {
// console.log("53");
// console.log(nextProps.user);
this.setState({
namezh: nextProps.namezh,
})
}
}
if (nextProps.passmm != this.props.passmm) {
// console.log("50");
// console.log(nextProps.user);
if (nextProps.passmm !== undefined) {
// console.log("53");
// console.log(nextProps.user);
this.setState({
passmm: nextProps.passmm,
})
}
}
}
Clickteacher=(e)=>{ Clickteacher=(e)=>{
console.log(e); console.log(e);
if(e === "teacher"){ if(e === "teacher"){
@ -98,6 +134,8 @@ class InterestpageComponent extends Component {
//跳转然后登入 //跳转然后登入
Jumptotheinterestpage=()=>{ Jumptotheinterestpage=()=>{
console.log(this.state.login);
console.log(this.state.password);
var url = "/accounts/login.json"; var url = "/accounts/login.json";
axios.post(url, { axios.post(url, {
login: this.props.login, login: this.props.login,
@ -107,16 +145,15 @@ class InterestpageComponent extends Component {
return return
} }
if (response.status === 200) { if (response.status === 200) {
if (response.data.status === 402) { // if (response.data.status === 402) {
window.location.href = response.data.url; // window.location.href = response.data.url;
} else { // } else {
broadcastChannelPostMessage('refreshPage') // broadcastChannelPostMessage('refreshPage')
this.setState({ // this.setState({
isRender: false // isRender: false
}) // })
window.location.href = "/" window.location.href = "/"
// }
}
} }

Loading…
Cancel
Save