补充v2.6.0升级说明及修复新增account提示mysql错误问题

This commit is contained in:
zengqiao
2022-01-18 15:48:05 +08:00
parent 05022f8db4
commit 3b0c208eff
7 changed files with 28 additions and 56 deletions

View File

@@ -58,6 +58,7 @@ public class BaseSessionSignOn extends AbstractSingleSignOn {
if(ValidateUtils.isNull(ldapAttrsInfo)){
return Result.buildFrom(ResultStatus.LDAP_AUTHENTICATION_FAILED);
}
//LDAP验证通过拿LDAP的sAMAccountName替换dto对象的值便于第一次自动注册采用LDAP值并且第二次也避免REPLACE
dto.setUsername(ldapAttrsInfo.get("sAMAccountName").toString());
accountResult = accountService.getAccountDO(dto.getUsername());
@@ -68,9 +69,9 @@ public class BaseSessionSignOn extends AbstractSingleSignOn {
accountDO.setUsername(dto.getUsername());
accountDO.setRole(AccountRoleEnum.getUserRoleEnum(authUserRegistrationRole).getRole());
accountDO.setPassword(dto.getPassword());
accountDO.setDisplayName(ldapAttrsInfo.get("displayName").toString());
accountDO.setDepartment(ldapAttrsInfo.get("department").toString());
accountDO.setMail(ldapAttrsInfo.get("mail").toString());
accountDO.setDisplayName(ldapAttrsInfo.getOrDefault("displayName", "").toString());
accountDO.setDepartment(ldapAttrsInfo.getOrDefault("department", "").toString());
accountDO.setMail(ldapAttrsInfo.getOrDefault("mail", "").toString());
accountService.createAccount(accountDO);
}