forked from github/dataease
fix: 修复重复ldap用户
This commit is contained in:
parent
97a4c8bd72
commit
2e1ec00ad4
@ -70,12 +70,16 @@ public class AuthServer implements AuthApi {
|
||||
DataEaseException.throwException(validateResult.getMsg());
|
||||
}
|
||||
XpackLdapUserEntity ldapUserEntity = validateResult.getData();
|
||||
LdapAddRequest ldapAddRequest = new LdapAddRequest();
|
||||
ldapAddRequest.setUsers(new ArrayList<XpackLdapUserEntity>(){{add(ldapUserEntity);}});
|
||||
ldapAddRequest.setEnabled(1L);
|
||||
ldapAddRequest.setDeptId(1L);
|
||||
ldapAddRequest.setRoleIds(new ArrayList<Long>(){{add(2L);}});
|
||||
sysUserService.saveLdapUsers(ldapAddRequest);
|
||||
SysUserEntity user = authUserService.getUserByName(username);
|
||||
if(ObjectUtils.isEmpty(user) || ObjectUtils.isEmpty(user.getUserId())) {
|
||||
LdapAddRequest ldapAddRequest = new LdapAddRequest();
|
||||
ldapAddRequest.setUsers(new ArrayList<XpackLdapUserEntity>(){{add(ldapUserEntity);}});
|
||||
ldapAddRequest.setEnabled(1L);
|
||||
ldapAddRequest.setDeptId(1L);
|
||||
ldapAddRequest.setRoleIds(new ArrayList<Long>(){{add(2L);}});
|
||||
sysUserService.saveLdapUsers(ldapAddRequest);
|
||||
}
|
||||
|
||||
username = validateResult.getData().getUserName();
|
||||
}
|
||||
// 增加ldap登录方式
|
||||
|
Loading…
Reference in New Issue
Block a user