fix: 修复用户可选分组不能选择用户分组 (close #528)

This commit is contained in:
1808837298@qq.com
2024-10-14 16:15:10 +08:00
parent 40baa636e4
commit f599c65944
6 changed files with 38 additions and 14 deletions

View File

@@ -42,7 +42,7 @@ func Distribute() func(c *gin.Context) {
tokenGroup := c.GetString("token_group")
if tokenGroup != "" {
// check common.UserUsableGroups[userGroup]
if _, ok := common.UserUsableGroups[tokenGroup]; !ok {
if _, ok := common.GetUserUsableGroups(userGroup)[tokenGroup]; !ok {
abortWithOpenAiMessage(c, http.StatusForbidden, fmt.Sprintf("令牌分组 %s 已被禁用", tokenGroup))
return
}