From 4cbcafc062fbcd279a81f8b3a1f3414ce53646b3 Mon Sep 17 00:00:00 2001 From: 7a1dd609-d238-4580-9d5f-ee8412b0f5bc <7a1dd609-d238-4580-9d5f-ee8412b0f5bc@bankofchina.com> Date: Wed, 5 Feb 2025 11:53:14 +0800 Subject: [PATCH] fix: worng in tickrt return --- main.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/main.py b/main.py index 053c448..84af06d 100644 --- a/main.py +++ b/main.py @@ -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__':