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__()}