|
|
|
@ -156,7 +156,35 @@ class Challenges extends Component {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
startgameid=(id)=>{
|
|
|
|
|
|
|
|
|
|
let url = "/shixuns/" + id + "/shixun_exec.json";
|
|
|
|
|
axios.get(url).then((response) => {
|
|
|
|
|
|
|
|
|
|
if (response.data.status === -2) {
|
|
|
|
|
this.setState({
|
|
|
|
|
shixunsreplace:true,
|
|
|
|
|
hidestartshixunsreplacevalue:response.data.message+".json"
|
|
|
|
|
})
|
|
|
|
|
} else if (response.data.status === -1) {
|
|
|
|
|
console.log(response)
|
|
|
|
|
}else if(response.data.status===-3){
|
|
|
|
|
this.setState({
|
|
|
|
|
shixunsmessage:response.data.message,
|
|
|
|
|
startshixunCombattype:true,
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
window.location.href = "/tasks/" + response.data.game_identifier;
|
|
|
|
|
// window.location.href = path
|
|
|
|
|
// let path="/tasks/"+response.data.game_identifier;
|
|
|
|
|
// this.props.history.push(path);
|
|
|
|
|
}
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
hidestartshixunsreplace=(url)=>{
|
|
|
|
|
this.setState({
|
|
|
|
@ -167,7 +195,7 @@ class Challenges extends Component {
|
|
|
|
|
// let path="/shixuns/"+response.data.shixun_identifier+"/challenges";
|
|
|
|
|
// this.props.history.push(path);
|
|
|
|
|
message.success('重置成功,正在进入实训!');
|
|
|
|
|
this.startshixunCombat(response.data.shixun_identifier);
|
|
|
|
|
this.startgameid(response.data.shixun_identifier);
|
|
|
|
|
this.setState({
|
|
|
|
|
shixunsreplace:false,
|
|
|
|
|
isSpin:false,
|
|
|
|
@ -179,11 +207,7 @@ class Challenges extends Component {
|
|
|
|
|
).catch((error) => {
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
this.setState({
|
|
|
|
|
startbtn:false,
|
|
|
|
|
shixunsreplace:false,
|
|
|
|
|
isSpin:false
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//编辑实训题目选择题
|
|
|
|
|