统一角色体系为admin/agent/user,修复代理查询角色错误,添加语言切换和明暗切换
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user