From ddf72a55507fb020f99bcef7b20b227886efae1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sat, 22 Jun 2019 19:45:11 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=BC=80=E5=90=AF=E5=AE=9E?= =?UTF-8?q?=E8=AE=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/AppConfig.js | 2 +- public/react/src/modules/tpm/TPMBanner.js | 49 ++++++----------------- 2 files changed, 14 insertions(+), 37 deletions(-) diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index aa99f16f5..05a4463cd 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -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参考来控制 diff --git a/public/react/src/modules/tpm/TPMBanner.js b/public/react/src/modules/tpm/TPMBanner.js index f6355ec51..51d4cee9f 100644 --- a/public/react/src/modules/tpm/TPMBanner.js +++ b/public/react/src/modules/tpm/TPMBanner.js @@ -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 = ; return ( shixunsDetails===undefined?"": @@ -661,7 +636,7 @@ class TPMBanner extends Component { shixunsDetails.task_operation[0] === "查看实战" ? "查看我的实战光辉历史" : shixunsDetails.task_operation[0] === "模拟实战" ? "模拟完成实战任务" : shixunsDetails.task_operation[0] === "开启挑战" ? "开始学习并完成实战任务" : "" }> - 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} > + 实训已经更新了,正在为您重置! this.hidestartshixunsreplace(hidestartshixunsreplacevalue)}>知道了! + onClick={() => this.hidestartshixunsreplace(hidestartshixunsreplacevalue)}>知道了 +
实训已经更新了,正在为您重置!