fix: 限制IM租户列表为当前租户

This commit is contained in:
richjohnrambo
2026-09-20 16:53:38 +08:00
parent 6bf364ec0b
commit fd4ff85191
+8
View File
@@ -76,6 +76,14 @@ func (s *sSysImTenant) List(ctx context.Context, in *sysin.ImTenantListInp) (lis
dao.ImTenant.Columns().UpdatedAt,
)
if !isImPlatformAdmin(ctx, contexts.GetUserId(ctx)) {
tenantId := contexts.GetTenantId(ctx)
if tenantId <= 0 {
err = gerror.New("当前管理员未关联IM租户")
return
}
mod = mod.Where(dao.ImTenant.Columns().Id, tenantId)
}
if in.Id > 0 {
mod = mod.Where(dao.ImTenant.Columns().Id, in.Id)
}