Bläddra i källkod

Merge branch 'hotfix/websocket_getCookie' into 'master'

Hotfix/websocket get cookie

See merge request o2oa/o2oa!1758
胡起 5 år sedan
förälder
incheckning
0cf34ef68c

+ 13 - 13
build.xml

@@ -82,7 +82,7 @@
 			{
 			"windows": {
 			"system": "windows",
-			"name": "o2server-windows-${VERSION}",
+			"name": "o2server-${VERSION}-windows",
 			"fileName": "o2server-${VERSION}-windows.zip",
 			"fileSize": "${length_win_mb}MB",
 			"updateTime": "${TODAY}",
@@ -91,7 +91,7 @@
 			},
 			"linux": {
 			"system": "linux",
-			"name": "o2server-linux-${VERSION}",
+			"name": o2server-${VERSION}-linux-x86",
 			"fileName": "o2server-${VERSION}-linux-x86.zip",
 			"fileSize": "${length_linux_mb}MB",
 			"updateTime": "${TODAY}",
@@ -100,7 +100,7 @@
 			},
 			"macos": {
 			"system": "macos",
-			"name": "o2server-macos-${VERSION}",
+			"name": "o2server-${VERSION}-macos",
 			"fileName": "o2server-${VERSION}-macos.zip",
 			"fileSize": "${length_macos_mb}MB",
 			"updateTime": "${TODAY}",
@@ -109,7 +109,7 @@
 			},
 			"aix": {
 			"system": "aix",
-			"name": "o2server-aix-${VERSION}",
+			"name": "o2server-${VERSION}-aix",
 			"fileName": "o2server-${VERSION}-aix.zip",
 			"fileSize": "${length_aix_mb}MB",
 			"updateTime": "${TODAY}",
@@ -127,7 +127,7 @@
 			},
 			"mips": {
 			"system": "mips",
-			"name": "o2server-${VERSION}-mips",
+			"name": "o2server-${VERSION}-linux-mips",
 			"fileName": "o2server-${VERSION}-linux-mips.zip",
 			"fileSize": "${length_mips_mb}MB",
 			"updateTime": "${TODAY}",
@@ -136,7 +136,7 @@
 			},
 			"arm": {
 			"system": "arm",
-			"name": "o2server-${VERSION}-arm",
+			"name": "o2server-${VERSION}-linux-arm",
 			"fileName": "o2server-${VERSION}-linux-arm.zip",
 			"fileSize": "${length_arm_mb}MB",
 			"updateTime": "${TODAY}",
@@ -151,7 +151,7 @@
 			"publishTime": "${TODAY}",
 			"windows": {
 			"system": "windows",
-			"name": "o2server-windows-${VERSION}",
+			"name": "o2server-${VERSION}-windows",
 			"fileName": "o2server-${VERSION}-windows.zip",
 			"fileSize": "${length_win_mb}MB",
 			"updateTime": "${TODAY}",
@@ -160,7 +160,7 @@
 			},
 			"linux": {
 			"system": "linux",
-			"name": "o2server-linux-${VERSION}",
+			"name": "o2server-${VERSION}-linux-x86",
 			"fileName": "o2server-${VERSION}-linux-x86.zip",
 			"fileSize": "${length_linux_mb}MB",
 			"updateTime": "${TODAY}",
@@ -169,7 +169,7 @@
 			},
 			"macos": {
 			"system": "macos",
-			"name": "o2server-macos-${VERSION}",
+			"name": "o2server-${VERSION}-macos",
 			"fileName": "o2server-${VERSION}-macos.zip",
 			"fileSize": "${length_macos_mb}MB",
 			"updateTime": "${TODAY}",
@@ -178,7 +178,7 @@
 			},
 			"aix": {
 			"system": "aix",
-			"name": "o2server-aix-${VERSION}",
+			"name": "o2server-${VERSION}-aix",
 			"fileName": "o2server-${VERSION}-aix.zip",
 			"fileSize": "${length_aix_mb}MB",
 			"updateTime": "${TODAY}",
@@ -196,7 +196,7 @@
 			},
 			"mips": {
 			"system": "mips",
-			"name": "o2server-${VERSION}-mips",
+			"name": "o2server-${VERSION}-linux-mips",
 			"fileName": "o2server-${VERSION}-linux-mips.zip",
 			"fileSize": "${length_mips_mb}MB",
 			"updateTime": "${TODAY}",
@@ -205,7 +205,7 @@
 			},
 			"arm": {
 			"system": "arm",
-			"name": "o2server-${VERSION}-arm",
+			"name": "o2server-${VERSION}-linux-arm",
 			"fileName": "o2server-${VERSION}-linux-arm.zip",
 			"fileSize": "${length_arm_mb}MB",
 			"updateTime": "${TODAY}",
@@ -368,4 +368,4 @@
 			</zipfileset>
 		</zip>
 	</target>
-</project>
+</project>

+ 24 - 16
o2server/x_organization_assemble_personal/src/main/java/com/x/organization/assemble/personal/jaxrs/person/ActionSetPassword.java

@@ -56,18 +56,19 @@ class ActionSetPassword extends BaseAction {
 				if (StringUtils.isEmpty(wi.getConfirmPassword())) {
 					throw new ExceptionConfirmPasswordEmpty();
 				}
+				/*
 				if (!StringUtils.equals(wi.getNewPassword(), wi.getConfirmPassword())) {
 					throw new ExceptionTwicePasswordNotMatch();
 				}
 				if (StringUtils.equals(wi.getNewPassword(), wi.getOldPassword())) {
 					throw new ExceptionNewPasswordSameAsOldPassword();
-				}
-				
+				}*/
+
 				String oldPassword = wi.getOldPassword();
 				String newPassword = wi.getNewPassword();
 				String confirmPassword = wi.getConfirmPassword();
 				String isEncrypted = wi.getIsEncrypted();
-				
+
 				//RSA解秘
 				if (!StringUtils.isEmpty(isEncrypted)) {
 					if(isEncrypted.trim().equalsIgnoreCase("y")) {
@@ -76,8 +77,15 @@ class ActionSetPassword extends BaseAction {
 						confirmPassword = this.decryptRSA(confirmPassword);
 					}
 				}
-				
-				
+
+				if (!StringUtils.equals(newPassword, confirmPassword)) {
+					throw new ExceptionTwicePasswordNotMatch();
+				}
+				if (StringUtils.equals(newPassword, oldPassword)) {
+					throw new ExceptionNewPasswordSameAsOldPassword();
+				}
+
+
 				if (BooleanUtils.isTrue(Config.person().getSuperPermission())
 						&& StringUtils.equals(Config.token().getPassword(), oldPassword)) {
 					logger.info("user{name:" + person.getName() + "} use superPermission.");
@@ -90,8 +98,8 @@ class ActionSetPassword extends BaseAction {
 						throw new ExceptionInvalidPassword(Config.person().getPasswordRegexHint());
 					}
 				}
-				
-				
+
+
 				emc.beginTransaction(Person.class);
 				business.person().setPassword(person, wi.getNewPassword());
 				emc.commit();
@@ -104,8 +112,8 @@ class ActionSetPassword extends BaseAction {
 			return result;
 		}
 	}
-	
-	
+
+
 		public  String decryptRSA(String strDecrypt) {
 			String privateKey;
 			String decrypt = null;
@@ -117,7 +125,7 @@ class ActionSetPassword extends BaseAction {
 			}
 			return decrypt;
 		}
-	
+
 		public  String  getPrivateKey() {
 			 String privateKey = "";
 			 try {
@@ -131,19 +139,19 @@ class ActionSetPassword extends BaseAction {
 		}
 
 	public static class Wi extends GsonPropertyObject {
-		
+
 		@FieldDescribe("原密码")
 		private String oldPassword;
-		
+
 		@FieldDescribe("新密码")
 		private String newPassword;
-		
+
 		@FieldDescribe("确认新密码")
-		private String confirmPassword;	
-		
+		private String confirmPassword;
+
 		@FieldDescribe("是否启用加密,默认不加密,启用(y)。注意:使用加密先要在服务器运行 create encrypt key")
 		private String isEncrypted;
-		
+
 		public String getOldPassword() {
 			return oldPassword;
 		}

+ 1 - 1
o2web/source/o2_core/o2/xDesktop/WebSocket.js

@@ -42,7 +42,7 @@ MWF.xDesktop.WebSocket = new Class({
 
     connect: function(){
         if (layout.config.webSocketEnable){
-            var ws = this.ws+"?x-token="+encodeURIComponent(Cookie.read("x-token"));
+            var ws = this.ws+"?x-token="+encodeURIComponent(layout.session.token);
             ws = o2.filterUrl(ws);
 
             try{