fix: 限制IM租户列表为当前租户
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user