调整逻辑。临时提交

This commit is contained in:
zw
2025-08-18 22:20:23 +08:00
parent 906523b5ba
commit 019166f730
7 changed files with 112 additions and 150 deletions

View File

@@ -16,7 +16,6 @@ from Entity.ResultData import ResultData
from Utils.ControlUtils import ControlUtils
from Utils.ThreadManager import ThreadManager
from script.ScriptManager import ScriptManager
from Entity.Variables import accountToken
from Entity.Variables import anchorList, addModelToAnchorList
app = Flask(__name__)
@@ -75,28 +74,41 @@ listener_thread.start()
@app.route('/passToken', methods=['POST'])
def passToken():
try:
data = request.get_json()
token = data['token']
Requester.requestPrologue(token)
return ResultData(data="").toJson()
except Exception as e:
print(e)
return ResultData(data="").toJson()
@app.route('/getName', methods=['POST'])
def getName():
data = request.get_json()
accountToken = data['token']
print(accountToken)
return accountToken
Requester.requestPrologue()
return ResultData(data="").toJson()
# 获取设备列表
@app.route('/deviceList', methods=['GET'])
def deviceList():
while not dataQueue.empty():
obj = dataQueue.get()
type = obj["type"]
if type == 1:
listData.append(obj)
else:
for data in listData:
if data.get("deviceId") == obj.get("deviceId") and data.get("screenPort") == obj.get("screenPort"):
listData.remove(data)
return ResultData(data=listData).toJson()
try:
while not dataQueue.empty():
obj = dataQueue.get()
type = obj["type"]
if type == 1:
listData.append(obj)
else:
for data in listData:
if data.get("deviceId") == obj.get("deviceId") and data.get("screenPort") == obj.get("screenPort"):
listData.remove(data)
return ResultData(data=listData).toJson()
except Exception as e:
print(e)
return ResultData(data=[]).toJson()
# 获取设备应用列表
@app.route('/deviceAppList', methods=['POST'])