实训计时

courseware
dinglink 5 years ago
parent 48a4f91e32
commit 0c877307f0

@ -46,11 +46,7 @@ debugType = "admin";
// 老师
// debugType="teacher";
// 学生
<<<<<<< HEAD
//debugType="student";
=======
// debugType="student";
>>>>>>> 97765680b4f08ade017f6db22b1c76dcb0ae29f7

@ -133,13 +133,15 @@ class TPIContextProvider extends Component {
})
}
componentWillMount () {
// 拦截判断是否离开当前页面
}
componentWillUnmount() {
this.costTimeInterval && window.clearInterval(this.costTimeInterval)
}
componentDidMount() {
window.$(window).unload( ()=>{
console.log(12321)
});
// TODO 登录状态的判断?
// request
@ -161,12 +163,16 @@ class TPIContextProvider extends Component {
}
}, 1000)
// 页面离开时存下用户的任务耗时
window.$(window).bind('beforeunload', function (e) {
console.log(111111)
// // 页面离开时存下用户的任务耗时
window.$(window).bind('beforeunload',()=>{
console.log(111)
this._updateCostTime();
})
window.$(window).unload( ()=>{
this._updateCostTime();
});
// // 页面离开时存下用户的任务耗时
// window.$(window).unload( ()=>{
// this._updateCostTime();
@ -190,6 +196,7 @@ class TPIContextProvider extends Component {
if (window.location.port == 3007) {
testPath = 'http://test-newweb.educoder.net'
}
console.log(222)
// var url = `${testPath}/api/v1/games/${ game.identifier }/cost_time`
var url = `${testPath}/api/tasks/${ game.identifier }/cost_time${getRandomNumber()}`
window.$.ajax({

Loading…
Cancel
Save