解决实训刷新无数据的问题

courseware
dinglink 5 years ago
parent abe56a3036
commit bb885624ee

@ -46,7 +46,7 @@ debugType = "admin";
// 老师 // 老师
// debugType="teacher"; // debugType="teacher";
// 学生 // 学生
debugType="student"; //debugType="student";

@ -137,6 +137,9 @@ class TPIContextProvider extends Component {
this.costTimeInterval && window.clearInterval(this.costTimeInterval) this.costTimeInterval && window.clearInterval(this.costTimeInterval)
} }
componentDidMount() { componentDidMount() {
window.$(window).unload( ()=>{
console.log(12321)
});
// TODO 登录状态的判断? // TODO 登录状态的判断?
// request // request
@ -158,12 +161,24 @@ class TPIContextProvider extends Component {
} }
}, 1000) }, 1000)
// 页面离开时存下用户的任务耗时 // 页面离开时存下用户的任务耗时
window.$(window).bind('beforeunload', function (e) {
console.log(111111)
this._updateCostTime();
})
// // 页面离开时存下用户的任务耗时
// window.$(window).unload( ()=>{
// this._updateCostTime();
// });
window.$(window).unload( ()=>{
this._updateCostTime();
});
} }
// force 评测通过后异步执行该方法强制同步costTime到服务端 // force 评测通过后异步执行该方法强制同步costTime到服务端
_updateCostTime(async = false, force) { _updateCostTime(async = false, force) {
const { game, loading } = this.state; const { game, loading } = this.state;

@ -59,7 +59,7 @@ class LeftNav extends Component {
<div className="leftnav" style={{position: 'fixed', bottom:0}}> <div className="leftnav" style={{position: 'fixed', bottom:0}}>
<a href="/shixuns/uznmbg54?exit=true" className="leftnav-box-inner" id="exit_task_tab"> <a href="/shixuns/uznmbg54?exit=true" className="leftnav-box-inner" id="exit_task_tab">
<i className="fa fa-arrow-left font-20"></i><br/><span className="font-12">退出实训</span> <i className="fa fa-arrow-left font-20"></i><br/><span className="font-12">退出实训1</span>
</a> </a>
</div> </div>

Loading…
Cancel
Save