デバイスリストが空の場合の処理を追加
This commit is contained in:
parent
43519b104d
commit
e65f6024d3
1 changed files with 28 additions and 21 deletions
|
@ -66,17 +66,24 @@ class Auth():
|
|||
pc_uuid = str(kwargs["pc_uuid"])
|
||||
pc_token = str(kwargs["pc_token"])
|
||||
if "device_list" in kwargs:
|
||||
if kwargs["device_list"] == []:
|
||||
device_list = None
|
||||
else:
|
||||
device_list = kwargs["device_list"]
|
||||
else:
|
||||
pass
|
||||
keyboard_number = "own"
|
||||
mouse_number = "own"
|
||||
device_list = None
|
||||
|
||||
keyboard_number = 0
|
||||
mouse_number = 0
|
||||
|
||||
if "password_hash" in kwargs:
|
||||
password_hash = str(kwargs["password_hash"])
|
||||
cursor.execute("SELECT * FROM pc_list WHERE pc_number = %s AND password_hash = %s AND pc_uuid = %s AND pc_token = %s", (pc_number, password_hash, pc_uuid, pc_token))
|
||||
pc_info = cursor.fetchall()
|
||||
if pc_info:
|
||||
if device_list == None:
|
||||
pass
|
||||
else:
|
||||
for device in device_list:
|
||||
cursor.execute("SELECT * FROM keyboard_list WHERE device_instance_path = %s", (device["device_instance_path"],))
|
||||
keyboard_record = cursor.fetchall()
|
||||
|
|
Loading…
Reference in a new issue