From 47684e7f121088c1d8e34be4dda0d941ed690fbf Mon Sep 17 00:00:00 2001 From: XingQue Date: Tue, 28 Jul 2026 15:28:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20IM=E4=BF=B1=E4=B9=90=E9=83=A8=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E8=BF=94=E5=9B=9Ecurrent=5Fclub=5Fid=E5=B9=B6?= =?UTF-8?q?=E8=A7=84=E8=8C=83=E5=8C=96=E6=AF=94=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Cursor --- backend/views/kefu.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/backend/views/kefu.py b/backend/views/kefu.py index 7c05405..5948811 100644 --- a/backend/views/kefu.py +++ b/backend/views/kefu.py @@ -1375,8 +1375,12 @@ class KefuImUserClubFilterView(APIView): if scope == DATA_SCOPE_ALL: allowed_ids = [i for i in im_ids if i in club_map] else: - current = resolve_club_id_from_request(request) - allowed_ids = [i for i in im_ids if club_map.get(i) == current] + current = (resolve_club_id_from_request(request) or '').strip() + # 严格按用户归属俱乐部过滤;ClubID 空的用户归入默认俱乐部 + allowed_ids = [ + i for i in im_ids + if (club_map.get(i) or '').strip() == current + ] return Response({ 'code': 0, @@ -1384,6 +1388,10 @@ class KefuImUserClubFilterView(APIView): 'data': { 'allowed_ids': allowed_ids, 'club_map': club_map, + 'current_club_id': ( + None if scope == DATA_SCOPE_ALL + else (resolve_club_id_from_request(request) or '').strip() + ), 'scope': 'all' if scope == DATA_SCOPE_ALL else 'single', }, })