dev_forum
杨树明 5 years ago
parent a30134783d
commit f1eb51c1d5

@ -18,10 +18,9 @@ function locationurl(list){
}
// TODO 开发期多个身份切换
const debugType =""
// window.location.search.indexOf('debug=t') != -1 ? 'teacher' :
// window.location.search.indexOf('debug=s') != -1 ? 'student' : 'admin'
// window._debugType = debugType;
const debugType =window.location.search.indexOf('debug=t') != -1 ? 'teacher' :
window.location.search.indexOf('debug=s') != -1 ? 'mfp2guqj3' : 'admin'
window._debugType = debugType;
export function initAxiosInterceptors(props) {
// TODO 避免重复的请求 https://github.com/axios/axios#cancellation

@ -117,7 +117,7 @@ class Addcourses extends Component{
hidetojoinclass=()=>{
let {Addcoursestype}=this.props;
// console.log(this.props)
this.setState({
invite_code:undefined,
@ -132,11 +132,16 @@ class Addcourses extends Component{
student:null,
Addcoursestypes:false
})
this.props.hideAddcoursestype();
if(Addcoursestype===true){
this.props.hideAddcoursestype();
}
}
submitasyn=(course_id)=>{
let{professor}=this.state;
let{professor,Addcoursestype}=this.state;
if(professor===1){
this.setState({
loadtype:true,
@ -145,13 +150,17 @@ class Addcourses extends Component{
modalSave:(course_id)=>this.submitasyns(course_id),
Addcoursestype:false
})
this.props.hideAddcoursestype();
if(Addcoursestype===true){
this.props.hideAddcoursestype();
}
}else{
// let{course_id}=this.state;
this.setState({
Addcoursestype:false
})
this.props.hideAddcoursestype();
if(Addcoursestype===true){
this.props.hideAddcoursestype();
}
window.location.href ="/courses/"+course_id+"/students";
}
@ -161,6 +170,7 @@ class Addcourses extends Component{
}
submittojoinclass=()=>{
let{Addcoursestype}=this.state;
this.setState({
isSpin:true
})
@ -207,7 +217,9 @@ class Addcourses extends Component{
message:"提示",
description:response.data.message
});
this.props.hideAddcoursestype();
if(Addcoursestype===true){
this.props.hideAddcoursestype();
}
// this.props.showNotification(response.data.message);
@ -220,7 +232,9 @@ class Addcourses extends Component{
this.setState({
Addcoursestype:false
})
this.props.hideAddcoursestype();
if(Addcoursestype===true){
this.props.hideAddcoursestype();
}
// this.setState({
@ -318,7 +332,7 @@ class Addcourses extends Component{
keyboard={false}
className={"HomeworkModal"}
title="加入课堂"
visible={Addcoursestype===undefined?Addcoursestypes:Addcoursestype}
visible={Addcoursestype===undefined||Addcoursestype===false?Addcoursestypes:Addcoursestype}
closable={false}
footer={null}
destroyOnClose={true}

Loading…
Cancel
Save