2 回答

TA貢獻(xiàn)1900條經(jīng)驗(yàn) 獲得超5個(gè)贊
我不是很熟悉Angular或Owin,但是使用受法律保護(hù)的教育數(shù)據(jù),我們通過(guò)滴答秒數(shù),然后在AJAX調(diào)用完成后在處理程序中進(jìn)行重置來(lái)解決該問(wèn)題。
準(zhǔn)系統(tǒng)版本看起來(lái)像這樣:
var Countdown = {};
var Countdown.length = 3600 /* your session timeout here */;
var Countdown.seconds = Countdown.length;
var Countdown.tick = function() {
Countdown.seconds--;
if (Countdown.seconds == 0) {
/* handle timeout */
}
/* any additional processing code here */
}
var Countdown.reset = function() {
Countdown.seconds = Countdown.length;
/* any additional processing code here */
}
window.setInterval(Countdown.tick, 1000);
- 2 回答
- 0 關(guān)注
- 228 瀏覽
添加回答
舉報(bào)