fix: user filter revisit (#24088)

Co-authored-by: Qiu Jian <qiujian@yunionyun.com>
This commit is contained in:
Jian Qiu
2026-01-19 10:51:08 +08:00
committed by GitHub
parent aee8eecb3b
commit bbfc150e1e
3 changed files with 7 additions and 7 deletions

View File

@@ -199,11 +199,11 @@ type UserListInput struct {
RoleAssignmentProjectId string `json:"role_assignment_project_id"`
// email
Email string `json:"email"`
Email []string `json:"email"`
// mobile
Mobile string `json:"mobile"`
Mobile []string `json:"mobile"`
// displayname
Displayname string `json:"displayname"`
Displayname []string `json:"displayname"`
// 是否允许web控制台登录
AllowWebConsole *bool `json:"allow_web_console"`

View File

@@ -31,7 +31,7 @@ import (
func GetServiceIdByType(s *mcclient.ClientSession, typeStr string, verStr string) (string, error) {
params := jsonutils.NewDict()
if len(verStr) > 0 {
if len(verStr) > 0 && verStr != "v1" {
typeStr += "_" + verStr
}
params.Add(jsonutils.NewString(typeStr), "type")

View File

@@ -440,13 +440,13 @@ func (manager *SUserManager) ListItemFilter(
}
if len(query.Email) > 0 {
q = q.Equals("email", query.Email)
q = q.In("email", query.Email)
}
if len(query.Mobile) > 0 {
q = q.Equals("mobile", query.Mobile)
q = q.In("mobile", query.Mobile)
}
if len(query.Displayname) > 0 {
q = q.Equals("displayname", query.Displayname)
q = q.In("displayname", query.Displayname)
}
if query.AllowWebConsole != nil {
if *query.AllowWebConsole {