|
@@ -27,6 +27,7 @@ class SaveConfigRequest(BaseModel): |
|
|
@config_router.post("/wxchat/getconfig",response_model=None) |
|
|
@config_router.post("/wxchat/getconfig",response_model=None) |
|
|
#@validate_wxid |
|
|
#@validate_wxid |
|
|
async def get_config(request: Request, body: GetConfigRequest): |
|
|
async def get_config(request: Request, body: GetConfigRequest): |
|
|
|
|
|
|
|
|
wxid = body.wxid |
|
|
wxid = body.wxid |
|
|
if not wxid: |
|
|
if not wxid: |
|
|
return {"code": 400, "message": "wxid 不能为空"} |
|
|
return {"code": 400, "message": "wxid 不能为空"} |
|
@@ -80,6 +81,7 @@ async def save_config(request: Request, body: SaveConfigRequest): |
|
|
# 去重 |
|
|
# 去重 |
|
|
validated_config.chatroomIdWhiteList=list(set(validated_config.chatroomIdWhiteList)) |
|
|
validated_config.chatroomIdWhiteList=list(set(validated_config.chatroomIdWhiteList)) |
|
|
validated_config.addContactsFromChatroomIdWhiteList=list(set(validated_config.addContactsFromChatroomIdWhiteList)) |
|
|
validated_config.addContactsFromChatroomIdWhiteList=list(set(validated_config.addContactsFromChatroomIdWhiteList)) |
|
|
|
|
|
validated_config.privateChatWhiteList=list(set(validated_config.privateChatWhiteList)) |
|
|
except ValidationError as e: |
|
|
except ValidationError as e: |
|
|
return {'code': 407, 'message': e.errors().__str__()} |
|
|
return {'code': 407, 'message': e.errors().__str__()} |
|
|
|
|
|
|
|
|