fix: (rbac) batch query index

This commit is contained in:
xushuhui 2022-04-24 16:28:12 +08:00
parent a17d562c53
commit 28f360eaf9
1 changed files with 6 additions and 1 deletions

View File

@ -123,7 +123,12 @@ func (h APIHandler) ListIndex(w http.ResponseWriter, req *http.Request, ps httpr
keyword := h.GetParameterOrDefault(req, "keyword", "")
ids := strings.Split(clusterIds, ",")
for i := range ids {
ids[i] = `"` + ids[i] + `"`
if i < len(ids)-1 {
ids[i] = `"` + ids[i] + `",`
} else {
ids[i] = `"` + ids[i] + `"`
}
}
if len(ids) == 0 {
h.Error400(w, "id is required")