function isActive() {
var arr = ['index', 'login']
var result = arr.some(function (item) {
return window.location.href.indexOf(item) > 0
})
if (!result) {
window.lastTime = new Date().getTime();
window.currentTime = new Date().getTime();
window.timeOut = 10 * 60 * 1000;
window.listenTime = 1 * 60 * 1000;
window.onload = function () {
document.addEventListener('mousemove', function () {
window.lastTime = new Date().getTime();
console.log('鼠标移动了---------------lastTime------' + window.lastTime + "-------------currentTime----------" + window.currentTime + "-----相减时间---------" + (window.currentTime - window.lastTime))
})
window.addEventListener('focus', function () {
window.lastTime = new Date().getTime();
console.log('获得焦点了---------------lastTime------' + window.lastTime + "-------------currentTime----------" + window.currentTime + "-----相减时间---------" + (window.currentTime - window.lastTime))
})
window.addEventListener('blur', function () {
window.lastTime = new Date().getTime();
console.log('市区---------------lastTime------' + window.lastTime + "-------------currentTime----------" + window.currentTime + "-----相减时间---------" + (window.currentTime - window.lastTime))
})
window.addEventListener('click', function () {
window.lastTime = new Date().getTime();
console.log('点击---------------lastTime------' + window.lastTime + "-------------currentTime----------" + window.currentTime + "-----相减时间---------" + (window.currentTime - window.lastTime))
})
document.addEventListener('visibilitychange', function () {
window.stateww = document.visibilityState;
window.lastTime = new Date().getTime();
})
}
window.quitTime = window.setInterval(window.testTime, window.listenTime);
}
}
function testTime() {
window.currentTime = new Date().getTime();
console.log('currentTime', currentTime)
if ((window.currentTime - window.lastTime > window.timeOut)) {
window.clearInterval(window.quitTime);
Loading(true, "正在强制注销系统...");
window.setTimeout(function () {
GetAjax("/Login/OutLogin", "", function (data) {
window.location.href = '../login/index';
});
}, 200);
}
window.inputChange2 = document.getElementsByName("dialogFrame")[0].contentWindow.document.querySelector("body")
console.log(window.inputChange2);
window.inputChange2.addEventListener("click", function () {
window.lastTime = new Date().getTime();
console.log('ifram里边的内容对话框---------------lastTime------' + window.lastTime + "-------------currentTime----------" + window.currentTime + "-----相减时间---------" + (window.currentTime - window.lastTime))
})
}
<div class="panel window" style="display: block; width: 1188px; left: 360px; top: 110px; z-index: 9002;"><div class="panel-header panel-header-noborder window-header" style="width: 1188px;"><div class="panel-title">检出限</div><div class="panel-tool"><a href="javascript:void(0)" class="panel-tool-close"></a></div></div><div id="dd" style="width: 1186px; height: 714px;" title="" class="panel-body panel-body-noborder window-body">
<iframe name="dialogFrame" scrolling="no" frameborder="0" src="/ElementalRecord/DetectionLimit?psInspectType=1&psId=13dfbbc4-62ec-4fc8-bb15-1b7cc160342e" style="width:100%;height:95%;"></iframe></div></div>