v1.3.1 FIX

1、验证增强,增加算术验证码支持
2、修复新增用户时报错
3、修复操作日志报错
4、mybatis-jpa-extra升级到v2.0
This commit is contained in:
shimingxy
2020-04-24 15:35:28 +08:00
parent 20497c4aaa
commit bc8fbe3a47
20 changed files with 1786 additions and 1750 deletions

View File

@@ -43,14 +43,15 @@ public class UserInfoService extends JpaBaseService<UserInfo> {
return (UserInfoMapper)super.getMapper();
}
public boolean insert(UserInfo userinfo) {
if(super.insert(userinfo)){
return true;
}
return false;
}
public boolean insert(UserInfo userInfo) {
userInfo = passwordEncoder(userInfo);
if (super.insert(userInfo)) {
return true;
}
return false;
}
public boolean update(UserInfo userinfo) {
if(super.update(userinfo)){
@@ -102,20 +103,25 @@ public class UserInfoService extends JpaBaseService<UserInfo> {
e.printStackTrace();
}
}
public UserInfo passwordEncoder(UserInfo userInfo) {
String password = passwordEncoder.encode(PasswordReciprocal.getInstance().rawPassword(userInfo.getUsername(), userInfo.getPassword()));
userInfo.setDecipherable(ReciprocalUtils.encode(PasswordReciprocal.getInstance().rawPassword(userInfo.getUsername(), userInfo.getPassword())));
_logger.debug("decipherable : "+userInfo.getDecipherable());
userInfo.setPassword(password);
userInfo.setPasswordLastSetTime(DateUtils.getCurrentDateTimeAsString());
userInfo.setModifiedDate(DateUtils.getCurrentDateTimeAsString());
return userInfo;
}
public boolean changePassword(UserInfo userInfo) {
try {
if(WebContext.getUserInfo() != null) {
userInfo.setModifiedBy(WebContext.getUserInfo().getId());
}
String password = passwordEncoder.encode(PasswordReciprocal.getInstance().rawPassword(userInfo.getUsername(), userInfo.getPassword()));
userInfo.setDecipherable(ReciprocalUtils.encode(PasswordReciprocal.getInstance().rawPassword(userInfo.getUsername(), userInfo.getPassword())));
_logger.debug("decipherable : "+userInfo.getDecipherable());
userInfo.setPassword(password);
userInfo.setPasswordLastSetTime(DateUtils.getCurrentDateTimeAsString());
userInfo.setModifiedDate(DateUtils.getCurrentDateTimeAsString());
userInfo = passwordEncoder(userInfo);
if(getMapper().changePassword(userInfo) > 0){
ChangePassword changePassword=new ChangePassword();