This commit is contained in:
laodaming 2023-11-17 09:57:32 +08:00
parent 4d7a2edeea
commit cc1b2a657b

View File

@ -43,6 +43,9 @@ 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, "查询到的不是用户信息")
}
isUser := false
apiRsp := types.GetLdapUserInfoRsp{
UserId: 0,
@ -59,7 +62,7 @@ func (l *GetLdapUserInfoLogic) GetLdapUserInfo(req *types.GetLdapUserInfoReq, us
}
}
if !isUser {
return resp.SetStatusWithMessage(basic.CodeServiceErr, "查询到的不是用户信息")
return resp.SetStatusWithMessage(basic.CodeServiceErr, "查询到的不是用户信息!!")
}
case "uidNumber": //用户id
if len(attr.Values) == 0 {
@ -90,6 +93,9 @@ func (l *GetLdapUserInfoLogic) GetLdapUserInfo(req *types.GetLdapUserInfoReq, us
}
}
}
if apiRsp.UserId == 0 {
return resp.SetStatusWithMessage(basic.CodeServiceErr, "查询到的不是用户信息!!!")
}
return resp.SetStatusWithMessage(basic.CodeOK, "success", apiRsp)
}