This commit is contained in:
xyj 2024-01-26 17:33:20 +08:00
parent 9d6cb02c63
commit 90b6da4758
1 changed files with 2 additions and 3 deletions

View File

@ -264,11 +264,10 @@ async def process_data(request: Request):
clientid = data["clientid"]
pattern = r'^farm_[a-zA-Z0-9]{12}$'
amatch1 = re.match(pattern, clientid)
print(amatch1)
pattern = r'^test'
amatch2 = re.match(pattern, clientid)
print(amatch2)
if not amatch1 or not amatch2:
# 如果两个都不满足,那就错误
if not amatch1 and not amatch2:
return BaseResponse(code=500, msg="不符合畜牧clientId")
# 连接成功处理
if event == "client.connected":