update
This commit is contained in:
parent
42ad6f07ac
commit
6835697380
6
xumu.py
6
xumu.py
|
@ -1,3 +1,4 @@
|
||||||
|
import re
|
||||||
import time
|
import time
|
||||||
import json
|
import json
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
@ -261,8 +262,9 @@ async def process_data(request: Request):
|
||||||
data = json.loads(data)
|
data = json.loads(data)
|
||||||
event = data["event"]
|
event = data["event"]
|
||||||
clientid = data["clientid"]
|
clientid = data["clientid"]
|
||||||
print(clientid)
|
pattern = r"test"
|
||||||
if (not str(clientid).startswith("farm")) and (not str(clientid).startswith("test")):
|
a = re.match(pattern, clientid)
|
||||||
|
if not a:
|
||||||
return BaseResponse(code=500, msg="不符合畜牧clientId")
|
return BaseResponse(code=500, msg="不符合畜牧clientId")
|
||||||
# 连接成功处理
|
# 连接成功处理
|
||||||
if event == "client.connected":
|
if event == "client.connected":
|
||||||
|
|
Loading…
Reference in New Issue