更新开发者平台:代理商管理、版本管理、UI优化

This commit is contained in:
Admin
2026-04-29 15:19:17 +08:00
parent afe67d704e
commit 5c63882e71
139 changed files with 26533 additions and 365 deletions
+20
View File
@@ -134,6 +134,26 @@ func DeveloperAuth() gin.HandlerFunc {
}
}
// AgentAuth 代理商授权中间件
func AgentAuth() gin.HandlerFunc {
return func(c *gin.Context) {
role, exists := c.Get("role")
if !exists {
response.Error(c, http.StatusForbidden, "Access denied")
c.Abort()
return
}
if role != "agent" && role != "admin" {
response.Error(c, http.StatusForbidden, "Agent access required")
c.Abort()
return
}
c.Next()
}
}
// PackageAuth 套餐授权中间件
func PackageAuth() gin.HandlerFunc {
return func(c *gin.Context) {