From 1f070d0dc073178dd741d31c145f96c77c93fc4b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Thu, 2 Jan 2020 11:45:56 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4jupyter=E6=97=B6=E9=97=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shixunchild/Challenges/Challengesjupyter.js | 15 ++++++++------- public/react/src/redux/actions/jupyter.js | 10 +++++----- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js b/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js index 3fa98e88c..221f90764 100644 --- a/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js +++ b/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js @@ -113,16 +113,16 @@ class Challengesjupyter extends Component { }else{ if(response.data.status===0){ - if(response.data.useSeconds===null){ + if(response.data.remainingSeconds===null){ this.handleClickResetTpi() }else{ - let useSeconds=response.data.useSeconds; - let summain=3600 * 1000; - let sums= useSeconds * 1000; - let sum=summain-sums; + let remainingSeconds=response.data.remainingSeconds; + // let summain=3600 * 1000; + let sums= remainingSeconds * 1000; + // let sum=summain-sums; setTimeout(()=>{ this.setState({ - jupytertime:Date.now() +sum + jupytertime:Date.now() +sums }) },500); } @@ -420,6 +420,7 @@ class Challengesjupyter extends Component { onFinish=()=>{ let id=this.props.match.params.shixunId; + let that=this; Modal.confirm({ title: '倒计时截止', content: ( @@ -430,7 +431,7 @@ class Challengesjupyter extends Component { okText: '确定', cancelText: '取消', onOk () { - this.handleClickResetTpisync_code(id) + that.handleClickResetTpisync_code(id) } }) } diff --git a/public/react/src/redux/actions/jupyter.js b/public/react/src/redux/actions/jupyter.js index bb56ac6c8..47ddb2149 100644 --- a/public/react/src/redux/actions/jupyter.js +++ b/public/react/src/redux/actions/jupyter.js @@ -259,11 +259,11 @@ export const timeinfo_with_tpi = (identifier, dispatch) => { onCancel() {} }) }else{ - let useSeconds=res.data.useSeconds; - let summain=3600 * 1000; - let sums= useSeconds * 1000; - let sum=summain-sums; - setTimeout(()=>{ dispatch(addjypertime(Date.now() +sum))},500); + let remainingSeconds=res.data.remainingSeconds; + // let summain=3600 * 1000; + let sums= remainingSeconds * 1000; + // let sum=summain-sums; + setTimeout(()=>{ dispatch(addjypertime(Date.now() +sums))},500); } } }