From e2ca0607af0fc5f0bddbad8d04f36ec8345d6912 Mon Sep 17 00:00:00 2001 From: richjohnrambo Date: Sun, 20 Sep 2026 20:05:08 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=B9=B3=E5=8F=B0=E8=B6=85=E7=AE=A1?= =?UTF-8?q?=E6=8B=A5=E6=9C=89=E5=85=A8=E9=83=A8=E5=95=86=E6=88=B7=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E8=8C=83=E5=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/internal/consts/debris.go | 1 + server/internal/logic/sys/im_admin_scope.go | 3 +++ 2 files changed, 4 insertions(+) diff --git a/server/internal/consts/debris.go b/server/internal/consts/debris.go index 531c34c..1d91b51 100644 --- a/server/internal/consts/debris.go +++ b/server/internal/consts/debris.go @@ -13,6 +13,7 @@ const ( RegionSpilt = " / " // 地区分隔符 Unknown = "Unknown" // Unknown SuperRoleKey = "super" // 超管角色唯一标识符,通过角色验证超管 + ImPlatformRoleKey = "supreme_manager" // IM平台超管角色唯一标识符 MaxServeLogContentLen = 2048 // 最大保留服务日志内容大小 SysDefaultLanguage = "zh_CN" // 系统默认语言,当配置文件没有国际化配置时生效 ) diff --git a/server/internal/logic/sys/im_admin_scope.go b/server/internal/logic/sys/im_admin_scope.go index 6091cd5..054e367 100644 --- a/server/internal/logic/sys/im_admin_scope.go +++ b/server/internal/logic/sys/im_admin_scope.go @@ -71,6 +71,9 @@ func isImPlatformAdmin(ctx context.Context, operatorId int64) bool { if service.AdminMember().VerifySuperId(ctx, operatorId) { return true } + if contexts.GetRoleKey(ctx) == consts.ImPlatformRoleKey { + return true + } return contexts.IsCompanyDept(ctx) && contexts.GetTenantId(ctx) <= 0 }