调整开启实训

dev_forum
杨树明 6 years ago
parent 7e7f2b034b
commit ddf72a5550

@ -31,7 +31,7 @@ export function initAxiosInterceptors(props) {
// proxy = "http://testbdweb.trustie.net"
// proxy = "http://testbdweb.educoder.net"
proxy = "https://testeduplus2.educoder.net"
// proxy="http://47.96.87.25:48080"
// 在这里使用requestMap控制避免用户通过双击等操作发出重复的请求
// 如果需要支持重复的请求考虑config里面自定义一个allowRepeat参考来控制

@ -330,14 +330,13 @@ class TPMBanner extends Component {
if(response.status===200){
// let path="/shixuns/"+response.data.shixun_identifier+"/challenges";
// this.props.history.push(path);
if(response.data.status===-2){
this.shixunexec(response.data.message)
}
message.success('重置成功,正在进入实训!');
this.startshixunCombat(response.data.shixun_identifier);
this.setState({
shixunsreplace:false,
isSpin:false,
})
this.setState({
shixunsreplace:false,
isSpin:false,
})
// message.success('重置成功,正在进入实训!');
// this.startshixunCombat();
}}
@ -352,32 +351,8 @@ class TPMBanner extends Component {
}
shixunexec=(url)=>{
this.setState({
isSpin:true,
})
axios.get(url).then((response) => {
if(response.status===200){
// let path="/shixuns/"+response.data.shixun_identifier+"/challenges";
// this.props.history.push(path);
this.setState({
shixunsreplace:false,
isSpin:false,
})
message.success('重置成功,正在进入实训!');
this.startshixunCombat();
}}
).catch((error) => {
this.setState({
startbtn:false,
shixunsreplace:false,
isSpin:false
})
});
}
//开始实战按钮
startshixunCombat=()=>{
startshixunCombat=(id)=>{
let {shixunsDetails} = this.props
if( shixunsDetails.status>1){
this.setState({
@ -391,7 +366,6 @@ class TPMBanner extends Component {
}
let id = this.props.match.params.shixunId;
let url="/shixuns/"+id+"/shixun_exec.json";
axios.get(url).then((response) => {
if(response.status===200){
@ -402,6 +376,7 @@ class TPMBanner extends Component {
shixunsreplace:true,
hidestartshixunsreplacevalue:response.data.message+".json"
})
// this.shixunexec(response.data.message+".json")
}else if(response.data.status===-1){
console.log(response)
}else if(response.data.status===-3){
@ -541,7 +516,7 @@ class TPMBanner extends Component {
lineHeight: '30px',
};
const antIcon = <Icon type="loading" style={{ fontSize: 24 }} spin />;
return (
shixunsDetails===undefined?"":
@ -661,7 +636,7 @@ class TPMBanner extends Component {
shixunsDetails.task_operation[0] === "查看实战" ? "查看我的实战光辉历史" :
shixunsDetails.task_operation[0] === "模拟实战" ? "模拟完成实战任务" : shixunsDetails.task_operation[0] === "开启挑战" ? "开始学习并完成实战任务" : ""
}>
<a onClick={this.startshixunCombat}
<a onClick={()=>this.startshixunCombat(this.props.match.params.shixunId)}
className="fr user_default_btn task-btn-orange font-18"
id="shixun_operation" data-remote="true"
>
@ -698,13 +673,15 @@ class TPMBanner extends Component {
closable={false}
footer={null}
>
<Spin indicator={antIcon} spinning={this.state.isSpin}>
<div className="task-popup-content">
<p className="task-popup-text-center font-16 pb20">实训已经更新了正在为您重置!</p>
</div>
<div className="task-popup-submit clearfix">
<a className="task-btn task-btn-orange fr mr51"
onClick={() => this.hidestartshixunsreplace(hidestartshixunsreplacevalue)}>知道了</a>
onClick={() => this.hidestartshixunsreplace(hidestartshixunsreplacevalue)}>知道了</a>
</div>
</Spin>
</Modal>
<Modal

Loading…
Cancel
Save