|
@@ -27,7 +27,7 @@
|
|
|
<!-- <script src="js/uploadImgs.js"></script> -->
|
|
|
<script src="js/promptAndAlert.js"></script>
|
|
|
<script src="js/fileImg.js"></script>
|
|
|
- <style>
|
|
|
+
|
|
|
<script type="text/javascript">
|
|
|
mui.init()
|
|
|
</script>
|
|
@@ -141,6 +141,7 @@
|
|
|
mui.confirm('是否确认退出登录?', '系统提示', btnArray, function(e) {
|
|
|
if (e.index == 1) {
|
|
|
window.location="login.html";
|
|
|
+ localStorage.clear();
|
|
|
} else {
|
|
|
}
|
|
|
})
|
|
@@ -148,6 +149,33 @@
|
|
|
// $(document).on("click", '#back', function() {
|
|
|
// window.location="main.html";
|
|
|
// });
|
|
|
+
|
|
|
+ var idleTime = 30 * 60 * 1000; // 时间毫秒数
|
|
|
+ // 最后一次用户交互的时间变量
|
|
|
+ var lastInteraction = new Date().getTime();
|
|
|
+ // 设置一个定时器来检查用户是否空闲
|
|
|
+ setInterval(function() {
|
|
|
+ var currentTime = new Date().getTime();
|
|
|
+ var timeSinceLastInteraction = currentTime - lastInteraction;
|
|
|
+ // 如果用户在指定的空闲时间内没有进行任何操作,清空缓存
|
|
|
+ if (timeSinceLastInteraction > idleTime) {
|
|
|
+ localStorage.clear();
|
|
|
+ // sessionStorage.clear();
|
|
|
+ console.log('缓存已清空');
|
|
|
+ //跳转到登录页面
|
|
|
+ window.location="login.html";
|
|
|
+ }
|
|
|
+ }, 1000); // 每隔一秒检查一次
|
|
|
+ // 监听用户交互事件来更新lastInteraction的时间
|
|
|
+ window.onload = function() {
|
|
|
+ var events = ['mousedown', 'mousemove', 'keydown', 'scroll', 'touchstart'];
|
|
|
+ events.forEach(function(event) {
|
|
|
+ document.addEventListener(event, function() {
|
|
|
+ lastInteraction = new Date().getTime();
|
|
|
+ }, true);
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
var idcard;
|
|
|
var caseid;
|
|
|
window.onload = function initInfo(){
|