This commit is contained in:
xyj 2024-01-26 17:31:08 +08:00
parent b8eda59935
commit 455376463d
1 changed files with 3 additions and 5 deletions

View File

@ -263,12 +263,10 @@ async def process_data(request: Request):
event = data["event"] event = data["event"]
clientid = data["clientid"] clientid = data["clientid"]
pattern = r'^farm_[a-zA-Z0-9]{12}$' pattern = r'^farm_[a-zA-Z0-9]{12}$'
amatch = re.match(pattern, clientid) amatch1 = re.match(pattern, clientid)
if not amatch:
return BaseResponse(code=500, msg="不符合畜牧clientId")
pattern = r'^test' pattern = r'^test'
amatch = re.match(pattern, clientid) amatch2 = re.match(pattern, clientid)
if not amatch: if not amatch1 and not amatch2:
return BaseResponse(code=500, msg="不符合畜牧clientId") return BaseResponse(code=500, msg="不符合畜牧clientId")
# 连接成功处理 # 连接成功处理
if event == "client.connected": if event == "client.connected":