From 27d4166fae21330850a71527a4cd7de03232fd6e Mon Sep 17 00:00:00 2001 From: laodaming <11058467+laudamine@user.noreply.gitee.com> Date: Fri, 17 Nov 2023 11:40:08 +0800 Subject: [PATCH] fix --- .../internal/logic/getldaporganizationmemberslogic.go | 6 +++++- server/ldap-admin/internal/logic/getldapuserinfologic.go | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/server/ldap-admin/internal/logic/getldaporganizationmemberslogic.go b/server/ldap-admin/internal/logic/getldaporganizationmemberslogic.go index 0840862c..fb73cfc2 100644 --- a/server/ldap-admin/internal/logic/getldaporganizationmemberslogic.go +++ b/server/ldap-admin/internal/logic/getldaporganizationmemberslogic.go @@ -36,7 +36,11 @@ func (l *GetLdapOrganizationMembersLogic) GetLdapOrganizationMembers(req *types. if len(req.OrganizationDN) <= 3 || req.OrganizationDN[:3] != "ou=" { return resp.SetStatusWithMessage(basic.CodeRequestParamsErr, "参数错误,无效的组织DN") } - + //先获取组织信息 + /*ldapServer := ldap_lib.NewLdap(l.svcCtx.Ldap, l.svcCtx.Config.Ldap.BaseDN, l.svcCtx.Config.Ldap.RootDN) + filter := "(objectClass=groupOfUniqueNames)" + fields := "" + ldapServer.Search(req.OrganizationDN, ldap.ScopeWholeSubtree, filter, nil, nil)*/ return resp.SetStatus(basic.CodeOK) } diff --git a/server/ldap-admin/internal/logic/getldapuserinfologic.go b/server/ldap-admin/internal/logic/getldapuserinfologic.go index 918bee64..4a496298 100644 --- a/server/ldap-admin/internal/logic/getldapuserinfologic.go +++ b/server/ldap-admin/internal/logic/getldapuserinfologic.go @@ -43,8 +43,8 @@ func (l *GetLdapUserInfoLogic) GetLdapUserInfo(req *types.GetLdapUserInfoReq, us logx.Error(err) return resp.SetStatusWithMessage(basic.CodeServiceErr, "获取用户信息失败:"+err.Error()) } - if len(res.Entries) > 1 { - return resp.SetStatusWithMessage(basic.CodeServiceErr, "查询到的不是用户信息") + if len(res.Entries) != 1 { + return resp.SetStatusWithMessage(basic.CodeServiceErr, "查询到不到用户信息") } isUser := false apiRsp := types.GetLdapUserInfoRsp{