ソースを参照

配置白名单去重

develop
H Vs 17時間前
コミット
c9bed0fa11
1個のファイルの変更3行の追加0行の削除
  1. +3
    -0
      app/endpoints/config_endpoint.py

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


読み込み中…
キャンセル
保存