From 01fec576cbb0c8bf17d125d1198540b90ed42f0e Mon Sep 17 00:00:00 2001 From: tangjiang <465264938@qq.com> Date: Tue, 19 Nov 2019 20:03:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E5=9B=9E=E6=BB=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/context/TPIContextProvider.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/public/react/src/context/TPIContextProvider.js b/public/react/src/context/TPIContextProvider.js index d63e02174..dce678480 100644 --- a/public/react/src/context/TPIContextProvider.js +++ b/public/react/src/context/TPIContextProvider.js @@ -130,7 +130,6 @@ class TPIContextProvider extends Component { tpm_modified, tpm_script_modified, showUpdateDialog: false, - initTime: 0 }) } @@ -167,7 +166,7 @@ class TPIContextProvider extends Component { } // force 评测通过后,异步执行该方法,强制同步costTime到服务端 _updateCostTime(async = false, force) { - const { game, loading, initTime = 0 } = this.state; + const { game, loading } = this.state; // TODO 还有一种情况,通关后cost_time计时停止,没法通过这个判断 if (!force && (loading || !game || game.status === 2)) { return; // 已完成的任务不需要处理 @@ -178,13 +177,12 @@ class TPIContextProvider extends Component { } // var url = `${testPath}/api/v1/games/${ game.identifier }/cost_time` var url = `${testPath}/api/tasks/${ game.identifier }/cost_time` - const disTime = Math.abs(game.cost_time - initTime); window.$.ajax({ type: 'get', url: url, async: async, //IMPORTANT, the call will be synchronous data: { - time: disTime + time: game.cost_time } }).done((data) => { console.log('complete'); @@ -440,7 +438,6 @@ pop_box_new(htmlvalue, 480, 182); this.setState({ ...resData, - initTime: game.cost_time, currentGamePassed: false, loading: false, testSetsExpandedArray: testSetsExpandedArrayInitVal.slice(0),