From c9bed0fa11f81d32e9677eb9123dbd4447a95855 Mon Sep 17 00:00:00 2001 From: H Vs Date: Mon, 28 Apr 2025 09:41:38 +0800 Subject: [PATCH] =?UTF-8?q?=E9=85=8D=E7=BD=AE=E7=99=BD=E5=90=8D=E5=8D=95?= =?UTF-8?q?=E5=8E=BB=E9=87=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/endpoints/config_endpoint.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/endpoints/config_endpoint.py b/app/endpoints/config_endpoint.py index 9eca8c7..0e8b93b 100644 --- a/app/endpoints/config_endpoint.py +++ b/app/endpoints/config_endpoint.py @@ -77,6 +77,9 @@ async def save_config(request: Request, body: SaveConfigRequest): try: # 使用 Pydantic 严格校验数据类型和结构 validated_config = AgentConfig.model_validate(data) + # 去重 + validated_config.chatroomIdWhiteList=list(set(validated_config.chatroomIdWhiteList)) + validated_config.addContactsFromChatroomIdWhiteList=list(set(validated_config.addContactsFromChatroomIdWhiteList)) except ValidationError as e: return {'code': 407, 'message': e.errors().__str__()}