diff --git a/xumu.py b/xumu.py index af9abf5..0756616 100644 --- a/xumu.py +++ b/xumu.py @@ -1,3 +1,4 @@ +import re import time import json from typing import Any @@ -261,8 +262,9 @@ async def process_data(request: Request): data = json.loads(data) event = data["event"] clientid = data["clientid"] - print(clientid) - if (not str(clientid).startswith("farm")) and (not str(clientid).startswith("test")): + pattern = r"test" + a = re.match(pattern, clientid) + if not a: return BaseResponse(code=500, msg="不符合畜牧clientId") # 连接成功处理 if event == "client.connected":