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),