From 12e68486bce48b7fa91787af2a22129b11ca9714 Mon Sep 17 00:00:00 2001 From: sxpsxp12 <24519721+sxpsxp12@users.noreply.github.com> Date: Wed, 21 Aug 2024 14:32:22 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E8=BF=AD=E4=BB=A3?= =?UTF-8?q?=E5=99=A8=E6=8B=89=E5=8F=96=E9=A3=9E=E4=B9=A6=E7=BE=A4=E5=8E=86?= =?UTF-8?q?=E5=8F=B2=E6=B6=88=E6=81=AF=EF=BC=8C=E9=87=8D=E5=A4=8D=E6=8B=89?= =?UTF-8?q?=E5=8F=96=E6=B6=88=E6=81=AF=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/im/v1/model.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/service/im/v1/model.go b/service/im/v1/model.go index 43f142d2..f388c4e2 100644 --- a/service/im/v1/model.go +++ b/service/im/v1/model.go @@ -12189,12 +12189,13 @@ func (iterator *ListChatIterator) Next() (bool, *ListChat, error) { return false, nil, nil } - // 为0则拉取数据 + // 为0则拉取数据,或者上一页数据读取完成,尝试拉取下一页数据 if iterator.index == 0 || iterator.index >= len(iterator.items) { - if iterator.index != 0 && iterator.nextPageToken == nil { + //没有下一页数据了 + if iterator.index != 0 && (iterator.nextPageToken == nil || len(*iterator.nextPageToken) == 0) { return false, nil, nil } - if iterator.nextPageToken != nil { + if iterator.nextPageToken != nil && len(*iterator.nextPageToken) != 0 { iterator.req.apiReq.QueryParams.Set("page_token", *iterator.nextPageToken) } resp, err := iterator.listFunc(iterator.ctx, iterator.req, iterator.options...)