|
|
|
@ -238,24 +238,28 @@ class CompetitionCommon extends Component{
|
|
|
|
|
if(url===undefined){
|
|
|
|
|
let {data,signupdata}=this.state;
|
|
|
|
|
if(signupdata.enrolled===true){
|
|
|
|
|
this.props.history.replace(`/courses/${data.course_id}`);
|
|
|
|
|
}else{
|
|
|
|
|
//课堂学生不需要在竞赛报名的
|
|
|
|
|
if(data.member_of_course===true){
|
|
|
|
|
if (data.member_of_course === true) {
|
|
|
|
|
this.props.history.replace(`/courses/${data.course_id}`);
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
// 以学生身份调用加入课堂 进入课堂首页
|
|
|
|
|
let url="/courses/apply_to_join_course.json"
|
|
|
|
|
let url = "/courses/apply_to_join_course.json"
|
|
|
|
|
axios.post(url, {
|
|
|
|
|
invite_code: data.invite_code,
|
|
|
|
|
student:1
|
|
|
|
|
student: 1
|
|
|
|
|
}
|
|
|
|
|
).then((response) => {
|
|
|
|
|
if(response.data.status===0){
|
|
|
|
|
if (response.data.status === 0) {
|
|
|
|
|
this.props.history.replace(`/courses/${data.course_id}`);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
if (signupdata.personal === true) {
|
|
|
|
|
this.Personalregistration()
|
|
|
|
|
} else {
|
|
|
|
|
this.props.history.replace(`/competitions/${this.props.match.params.identifier}/enroll`);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
|
|