统一角色体系为admin/agent/user,修复代理查询角色错误,添加语言切换和明暗切换

This commit is contained in:
Admin
2026-04-29 17:33:54 +08:00
parent 5c63882e71
commit 2a8f32cbb9
21 changed files with 78 additions and 196 deletions
+3 -3
View File
@@ -114,7 +114,7 @@ func AdminAuth() gin.HandlerFunc {
}
}
// DeveloperAuth 开发者权限中间件
// DeveloperAuth 开发者权限中间件(管理员即开发者)
func DeveloperAuth() gin.HandlerFunc {
return func(c *gin.Context) {
role, exists := c.Get("role")
@@ -124,8 +124,8 @@ func DeveloperAuth() gin.HandlerFunc {
return
}
if role != "developer" && role != "admin" {
response.Error(c, http.StatusForbidden, "Developer access required")
if role != "admin" {
response.Error(c, http.StatusForbidden, "Admin access required")
c.Abort()
return
}