提交 49dc0397 编写于 作者: NoSubject's avatar NoSubject

Merge branch 'master' into 'develop'

Master

See merge request o2oa/o2oa!1759
......@@ -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>
\ No newline at end of file
</project>
......@@ -12,16 +12,19 @@ public class Proxy extends ProxyServlet {
@Override
protected String rewriteTarget(HttpServletRequest request) {
String url = request.getRequestURL().toString();
return target(url, this.getServletConfig().getInitParameter("port"));
String parameter = request.getQueryString();
return target(url, parameter, this.getServletConfig().getInitParameter("port"));
}
private String target(String url, String port) {
private String target(String url, String parameter, String port) {
int x = StringUtils.indexOf(url, ":", 8);
int y = StringUtils.indexOf(url, "/", 8);
if ((x > 0) && (y > 0)) {
return url.substring(0, x) + port(url, port) + url.substring(y);
return url.substring(0, x) + port(url, port) + url.substring(y)
+ (StringUtils.isBlank(parameter) ? "" : "?" + parameter);
} else if (y > 0) {
return url.substring(0, y) + port(url, port) + url.substring(y);
return url.substring(0, y) + port(url, port) + url.substring(y)
+ (StringUtils.isBlank(parameter) ? "" : "?" + parameter);
} else {
return null;
}
......
......@@ -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;
}
......
......@@ -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{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册