Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_home
daiao 5 years ago
commit 5451805217

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

Loading…
Cancel
Save