From b36682580d528a88685fc9d70d58c4acc300691b Mon Sep 17 00:00:00 2001
From: hdw <hdw@192.168.1.132>
Date: 星期三, 26 十二月 2018 11:13:11 +0800
Subject: [PATCH] 登陆有效性监测内容提交

---
 gx_tieta/WebRoot/js/base.js   |    4 +-
 gx_tieta/WebRoot/elegroup.jsp |    2 
 gx_tieta/WebRoot/oprsrch.jsp  |    2 
 gx_tieta/WebRoot/Top.jsp      |   64 +++++++++++++++++++++++++++++---
 4 files changed, 62 insertions(+), 10 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>
diff --git a/gx_tieta/WebRoot/elegroup.jsp b/gx_tieta/WebRoot/elegroup.jsp
index 50e87c5..f98ff46 100644
--- a/gx_tieta/WebRoot/elegroup.jsp
+++ b/gx_tieta/WebRoot/elegroup.jsp
@@ -307,7 +307,7 @@
 			}
 		});
 		
-		setUserName();
+		//setUserName();
 		//椤甸潰鍔犺浇瀹岀敓鎴愬寘鏈虹粍鍒楄〃
 		searchAllbaojiGroup();
 		
diff --git a/gx_tieta/WebRoot/js/base.js b/gx_tieta/WebRoot/js/base.js
index 924f582..ee1c917 100644
--- a/gx_tieta/WebRoot/js/base.js
+++ b/gx_tieta/WebRoot/js/base.js
@@ -26,7 +26,7 @@
 
 // 妫�鏌ュ綋鍓嶇敤鎴锋槸鍚﹀湪鍙︿竴涓绘満鐧婚檰
 function checkUserlogin(){
-	//console.info("check");
+	console.info("check***********************");
 	$.post("LoginAction_check",null,function(data){
 		data = eval("(" + data.result + ")");
 		user=data.uinf;
@@ -38,7 +38,7 @@
 			window.location.href="login.jsp";			
 		}else{
 			clearInterval(timeID);
-			timeID = setTimeout(checkUserlogin,5000);
+			timeID = setTimeout(checkUserlogin,100);
 		}
 	}).error(function(){
 		clearInterval(timeID);
diff --git a/gx_tieta/WebRoot/oprsrch.jsp b/gx_tieta/WebRoot/oprsrch.jsp
index b869e10..4ab0384 100644
--- a/gx_tieta/WebRoot/oprsrch.jsp
+++ b/gx_tieta/WebRoot/oprsrch.jsp
@@ -113,7 +113,7 @@
 
 	//鍒濆鍖栭〉闈㈠唴瀹�
 	$(document).ready(function(){
-		setUserName();
+		//setUserName();
 		
 		//瀹氫箟椤甸潰楂樺害
 		var srnHt=$(window).height();	//娴忚鍣ㄥ彲浠ュ尯鍩熺殑楂樺害

--
Gitblit v1.9.1