From 68356973804e0d6c4fddb368a45d668ea686ae72 Mon Sep 17 00:00:00 2001 From: xyj <10908227994@qq.com> Date: Fri, 26 Jan 2024 17:22:01 +0800 Subject: [PATCH] update --- xumu.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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":