From 94c3b603ae4fd3f26e23a33e3eabc781d9c08846 Mon Sep 17 00:00:00 2001 From: 81041 <81041@DESKTOP-025NVD9> Date: 星期三, 26 十二月 2018 11:33:37 +0800 Subject: [PATCH] Merge branch 'dev_lxw' of https://whyclxw1@gitlab.com/whyclxw1/gx_tieta.git into dev_lxw --- gx_tieta/WebRoot/Top.jsp | 64 +++++++++++++++++++++++++++++--- 1 files changed, 58 insertions(+), 6 deletions(-) diff --git a/gx_tieta/WebRoot/Top.jsp b/gx_tieta/WebRoot/Top.jsp index e9e049e..d0863f8 100644 --- a/gx_tieta/WebRoot/Top.jsp +++ b/gx_tieta/WebRoot/Top.jsp @@ -205,7 +205,7 @@ <script type="text/javascript" src="js/rightmenu.js"></script> <script type="text/javascript"> $(document).ready(function(){ - setUserName(); //璁剧疆鐢ㄦ埛鍚嶇О + //setUserName(); //璁剧疆鐢ㄦ埛鍚嶇О searchRecentlyAlarm(); //鏌ヨ鏈�杩�30绉掔殑璁惧鍜岀數姹犲憡璀� @@ -919,7 +919,7 @@ // 鍒ゆ柇褰撳墠椤甸潰涓嶆槸鐧婚檰椤甸潰寮�濮嬫墽琛屾娴嬫湇鍔″櫒鐘舵�� if(!loginPatt.test(url)) { - checkServer(); + //checkServer(); } var linkNum = 0; // 娴嬭瘯鏈嶅姟鍣ㄨ繛鎺ヨ鏁� =3 璺宠浆鍒扮櫥闄嗛〉闈� @@ -930,17 +930,17 @@ async: true, success: function(rs) { linkNum = 0; // 鍒濆鍖栨祴璇曡繛鎺� - setTimeout(checkServer, 500); + setTimeout(checkServer, 200); }, error:function() { - // 缃戠粶杩炴帴涓嶆甯� + // 缃戠粶杩炴帴涓嶆甯� if(!navigator.onLine) { linkNum = 0; - setTimeout(checkServer, 500); + setTimeout(checkServer, 200); }else{ linkNum++; // 鏈嶅姟鍣ㄨ繛鎺ヤ笉姝e父 - if(linkNum == 2) { + if(linkNum == 3) { console.info('鍑虹幇绗�'+linkNum+"娆℃祴璇曟湇鍔″櫒杩炴帴澶辫触锛佽烦杞埌鐧婚檰"); // 缃戠粶姝e父浣嗘湇鍔″櫒杩炵画澶氭妫�娴嬩笉姝e父璺宠浆鍒扮櫥闄嗛〉闈� alert('缃戠粶杩炴帴寮傚父锛岃妫�鏌ョ綉缁滆繛鎺ユ槸鍚︽甯革紒'); @@ -954,5 +954,57 @@ }); } })(jQuery); + + // 鐩戞祴鍚庡彴session鏄惁瀛樺垽鏂綋鍓嶇敤鎴疯繛鎺ユ槸鍚﹀悎娉� + ;(function ($) { + var url = window.location.href; + var loginPatt = /\/login.jsp/; + + // 鍒ゆ柇褰撳墠椤甸潰涓嶆槸鐧婚檰椤甸潰寮�濮嬫墽琛屾娴嬫湇鍔″櫒鐘舵�� + if(!loginPatt.test(url)) { + checkServer(); + } + + var linkNum = 0; // 娴嬭瘯鏈嶅姟鍣ㄨ繛鎺ヨ鏁� =3 璺宠浆鍒扮櫥闄嗛〉闈� + function checkServer() { + $.ajax({ + url:'LoginAction_check', + type: 'post', + async: true, + success: function(res) { + //console.log(res); + var rs = JSON.parse(res.result); + if(rs.code==0) { + linkNum = 0; // 鍒濆鍖栨祴璇曡繛鎺� + setTimeout(checkServer, 100); + }else { + alert(rs.msg); + window.location.replace("login.jsp"); + } + + }, + error: function() { + // 缃戠粶杩炴帴涓嶆甯� + if(!navigator.onLine) { + linkNum = 0; + setTimeout(checkServer, 100); + }else{ + linkNum++; + // 鏈嶅姟鍣ㄨ繛鎺ヤ笉姝e父 + if(linkNum == 3) { + console.info('鍑虹幇绗�'+linkNum+"娆℃祴璇曟湇鍔″櫒杩炴帴澶辫触锛佽烦杞埌鐧婚檰"); + // 缃戠粶姝e父浣嗘湇鍔″櫒杩炵画澶氭妫�娴嬩笉姝e父璺宠浆鍒扮櫥闄嗛〉闈� + alert('缃戠粶杩炴帴寮傚父锛岃妫�鏌ョ綉缁滆繛鎺ユ槸鍚︽甯革紒'); + window.location.replace("login.jsp"); + }else { + console.info('鍑虹幇绗�'+linkNum+"娆℃祴璇曟湇鍔″櫒杩炴帴澶辫触锛�"); + checkServer(); + } + } + } + }); + } + })(jQuery); + </script> </html> -- Gitblit v1.9.1