feat: add login test fun in unlock

This commit is contained in:
7a1dd609-d238-4580-9d5f-ee8412b0f5bc 2025-01-15 23:52:36 +08:00
parent 30a7ab684e
commit c6c00321b0

15
main.py
View File

@ -202,6 +202,21 @@ def unlock_process():
return jsonify({"apiName": "unlock", "apiInfo": "Unlock All DX Master Charts.", "apiUsage": "/unlock?userid=<userId>"}) return jsonify({"apiName": "unlock", "apiInfo": "Unlock All DX Master Charts.", "apiUsage": "/unlock?userid=<userId>"})
else: else:
userId = int(userId) userId = int(userId)
timestamp = int(time.time())
login_data = login(userId, timestamp)
if login_data['returnCode'] == 102:
returnCode = 403
status = "403 Forbidden"
info = "Unable to operate. Please refresh QrCode."
log = {}
elif login_data['returnCode'] == 100:
returnCode = 403
status = "403 Forbidden"
info = "Unable to operate. Probably User has logged in."
log = {}
elif login_data['returnCode'] == 1:
userdata_result = userdata(userId)
logout(userId, timestamp)
unlock(userId) unlock(userId)
returnCode = 200 returnCode = 200
status = "200 OK" status = "200 OK"