refactor(auth): replace direct token group setting with context key retrieval

This commit is contained in:
CaIon
2025-12-13 01:38:12 +08:00
parent 6e998eaf82
commit e0a79e853d
2 changed files with 9 additions and 3 deletions

View File

@@ -307,7 +307,7 @@ func SetupContextForToken(c *gin.Context, token *model.Token, parts ...string) e
} else {
c.Set("token_model_limit_enabled", false)
}
c.Set("token_group", token.Group)
common.SetContextKey(c, constant.ContextKeyTokenGroup, token.Group)
c.Set("token_cross_group_retry", token.CrossGroupRetry)
if len(parts) > 1 {
if model.IsAdmin(token.UserId) {