fix: worng in tickrt return

This commit is contained in:
7a1dd609-d238-4580-9d5f-ee8412b0f5bc 2025-02-05 11:53:14 +08:00
parent c74e539d60
commit 4cbcafc062

View File

@ -38,7 +38,7 @@ def bad_request(e):
@app.route("/")
def index():
return jsonify({"status": "200 OK", "timestamp": int(time.time()), "info": "Project Fragrance","availableApi": ["qr", "ticket", "mapstock", "unlock", "map"], "date": datetime.now(pytz.timezone('Asia/Shanghai')).strftime('%a, %d %b %Y %H:%M:%S GMT+8')}), 200
return jsonify({"status": "200 OK", "timestamp": int(time.time()), "info": "Project Fragrance","availableApi": ["qr", "ticket", "mapstock", "unlock", "map", "bonus"], "date": datetime.now(pytz.timezone('Asia/Shanghai')).strftime('%a, %d %b %Y %H:%M:%S GMT+8')}), 200
@app.route("/qr")
def qr_to_userid():
@ -94,8 +94,8 @@ def ticket():
ticket_data = get_ticket(userId)
if ticket_data['returnCode'] == 0:
logout(userId, timestamp)
returnCode = 405
status = "405 Method Not Allowed"
returnCode = 403
status = "403 Forbidden"
info = "WARNING: THIS INFO SHOULD NEVER APPEARS. IF YOU SEE THIS WARNING PLEASE CONTACT Telegram@sasakure. Unable to operate. Successfully Logged in. Probably User has had one ticket."
log = {"UserLoginApiStatus": 1, "UserLogoutApiStatus": 1}
elif ticket_data['returnCode'] == 1:
@ -296,7 +296,7 @@ def bonus():
status = "200 OK"
info = "Succeed."
log = {"UserLoginApiStatus": 1, "UploadUserPlaylogApiStatus": 1, "UpsertUserAllApi": 1, "UserLogoutApiStatus": 1}
data = jsonify({"status": status, "timestamp": timestamp, "info": info, "apiName": "unlock", "date": datetime.now(pytz.timezone('Asia/Shanghai')).strftime('%a, %d %b %Y %H:%M:%S GMT+8'), "userId": userId})
data = jsonify({"status": status, "timestamp": timestamp, "info": info, "apiName": "bonus", "date": datetime.now(pytz.timezone('Asia/Shanghai')).strftime('%a, %d %b %Y %H:%M:%S GMT+8'), "userId": userId})
return data, returnCode
if __name__ == '__main__':