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/js/base.js                                              |    4 +-
 gx_tieta/WebRoot/elegroup.jsp                                            |    2 
 gx_tieta/WebRoot/WEB-INF/classes/com/fgkj/services/User_infService.class |    0 
 gx_tieta/WebRoot/oprsrch.jsp                                             |    2 
 gx_tieta/src/com/fgkj/actions/User_infAction.java                        |   12 ++++++
 gx_tieta/WebRoot/batt-fault-manage.jsp                                   |   22 ++++++++++-
 gx_tieta/WebRoot/Top.jsp                                                 |   64 +++++++++++++++++++++++++++++---
 gx_tieta/WebRoot/WEB-INF/classes/com/fgkj/actions/User_infAction.class   |    0 
 gx_tieta/src/com/fgkj/services/User_infService.java                      |    7 +++
 9 files changed, 100 insertions(+), 13 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/WEB-INF/classes/com/fgkj/actions/User_infAction.class b/gx_tieta/WebRoot/WEB-INF/classes/com/fgkj/actions/User_infAction.class
index e2740b9..789d48e 100644
--- a/gx_tieta/WebRoot/WEB-INF/classes/com/fgkj/actions/User_infAction.class
+++ b/gx_tieta/WebRoot/WEB-INF/classes/com/fgkj/actions/User_infAction.class
Binary files differ
diff --git a/gx_tieta/WebRoot/WEB-INF/classes/com/fgkj/services/User_infService.class b/gx_tieta/WebRoot/WEB-INF/classes/com/fgkj/services/User_infService.class
index fa20e61..851df8b 100644
--- a/gx_tieta/WebRoot/WEB-INF/classes/com/fgkj/services/User_infService.class
+++ b/gx_tieta/WebRoot/WEB-INF/classes/com/fgkj/services/User_infService.class
Binary files differ
diff --git a/gx_tieta/WebRoot/batt-fault-manage.jsp b/gx_tieta/WebRoot/batt-fault-manage.jsp
index 27e1e6f..047e0db 100644
--- a/gx_tieta/WebRoot/batt-fault-manage.jsp
+++ b/gx_tieta/WebRoot/batt-fault-manage.jsp
@@ -366,9 +366,11 @@
 				searchfault();
 			});		
 
+			var isNewLoad = true;
 			// 鐪�-甯�-鏈烘埧-鐢垫睜缁�
 		    $(document).ready(function() {
 		        //椤甸潰鍔犺浇鏃舵煡璇㈢淮鎶ゅ尯涓殑鏋㈢航绫诲瀷
+		        var pre_province = getQueryString("province");
 		        $.post("User_battgroup_baojigroup_battgroupAction!serchStationName1InGroup", null,
 		        function(data) {
 		            data = data.result;
@@ -385,6 +387,9 @@
 		                    } else {
 		                        $option.text(data.data[i - 1]);
 		                        $option.attr("value", data.data[i - 1]);
+		                        if(pre_province == data.data[i - 1] && isNewLoad){
+		                        	$option.attr('selected',true);
+		                        }
 		                    }
 		                    $select.append($option);         
 		                }	                
@@ -400,6 +405,8 @@
 		        var data = {
 		            StationName1: $("#station_name1").val()
 		        };
+		        var pre_city = getQueryString('city');
+		        console.info(pre_city);
 		        // 璇锋眰鑾峰彇褰撳墠鐪佷笅鐨勫競
 		        $.ajax({
 		            type: "post",
@@ -417,6 +424,9 @@
 		                    for (var i = 0; i < _data.length; i++) {
 		                        var __data = _data[i];
 		                        var tmp = getOptionsData(__data.StationName2, __data.StationName2, __data);
+		                        if(pre_city == __data.StationName2 && isNewLoad){
+		                        	tmp = getOptionsData(__data.StationName2, __data.StationName2, __data,{},true);		                        	
+		                        }
 		                        optsList.push(tmp);
 		                    }
 		                    // 鏍规嵁鏁版嵁鐢熸垚涓嬫媺鍒楄〃
@@ -437,7 +447,7 @@
 					StationName1:$("#station_name1").val(),
 					StationName2:$("#city").val(),
 				};
-				
+				var pre_county = getQueryString('county');
 				// 鏌ヨ鍖哄幙
 				$.ajax({
 					type: 'post',
@@ -457,6 +467,9 @@
 									StationId: __data.StationId
 								};
 								var tmp = getOptionsData(__data.StationName5, __data.StationName5, __data, _attr);
+								if(pre_county == __data.StationName5 && isNewLoad){
+									tmp = getOptionsData(__data.StationName5, __data.StationName5, __data, _attr,{},true);
+								}
 								optsList.push(tmp);
 							}
 							
@@ -491,6 +504,7 @@
 		            StationName2: $("#city").val(),
 		            StationName5: $("#county").val()
 		        };
+		        var pre_home = getQueryString('home');
 		        //var selectvalue=$("#station_name1 option:selected").val();
 		        //alert(selectvalue);
 		        $.post("BattInfAction!serchStationName3", "json=" + JSON.stringify(tmp),
@@ -507,12 +521,16 @@
 		                        StationId: __data.StationId
 		                    };
 		                    var tmp = getOptionsData(__data.StationName3, __data.StationName3, __data, _attr);
+		                    if(pre_home == __data.StationName && isNewLoad){
+		                    	tmp = getOptionsData(__data.StationName3, __data.StationName3, __data, _attr,{},true);
+		                    	isNewLoad = false
+		                    }
 		                    optsList.push(tmp);
 		                }
 		
 		                // 鏍规嵁鏁版嵁鐢熸垚涓嬫媺鍒楄〃
 		                createOptions($select, optsList, true);
-		                
+		                searchfault();
 		            } else {
 		                $("#station_name3").text('').html('<option>鏆傛棤鍙祴鏈烘埧绔欑偣</option>');
 		               
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();	//娴忚鍣ㄥ彲浠ュ尯鍩熺殑楂樺害
diff --git a/gx_tieta/src/com/fgkj/actions/User_infAction.java b/gx_tieta/src/com/fgkj/actions/User_infAction.java
index cb1ab3b..748dcfc 100644
--- a/gx_tieta/src/com/fgkj/actions/User_infAction.java
+++ b/gx_tieta/src/com/fgkj/actions/User_infAction.java
@@ -225,6 +225,18 @@
 		return SUCCESS;
 	}
 	
+	public String checkSession() {
+		model = new ServiceModel();
+		Object obj = ActionUtil.getUser();
+		if(obj != null) {
+			model.setCode(1);
+		}else {
+			model.setCode(0);
+		}
+		result = ActionUtil.tojson(model);
+		return SUCCESS;
+	}
+	
 	public String test(){
 		System.out.println(upjson);
 		System.out.println(uif);
diff --git a/gx_tieta/src/com/fgkj/services/User_infService.java b/gx_tieta/src/com/fgkj/services/User_infService.java
index a142470..7a96d90 100644
--- a/gx_tieta/src/com/fgkj/services/User_infService.java
+++ b/gx_tieta/src/com/fgkj/services/User_infService.java
@@ -273,10 +273,15 @@
 			if (user != null && login_time != null) {
 				UserClient client = map.get(user.getUName());
 				if (client != null) {
-					if (login_time != client.getLogin_times()) {
+					if (login_time == client.getLogin_times()) {
+						model.setCode(0);
+					}else {
 						model.setCode(1);
 						model.setMsg(getText("The landing on the account in another host, please log in again"));
 					}
+				}else {
+					model.setCode(1);
+					model.setMsg(getText("You are not logged in, please log in"));
 				}
 			} else {
 				model.setCode(1);

--
Gitblit v1.9.1