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', }, })