fix: dict should not be a key.

This commit is contained in:
7a1dd609-d238-4580-9d5f-ee8412b0f5bc 2025-01-11 10:21:06 +08:00
parent 4f9c415da0
commit f015ff7cc9
3 changed files with 12 additions and 12 deletions

View File

@ -30,7 +30,7 @@ def method_not_allowed(e):
return jsonify({"status": "405 Method Not Allowed", "timestamp": int(time.time()), "info": "You are using the wrong method. Check the docs.", "date": datetime.now(pytz.timezone('Asia/Shanghai')).strftime('%a, %d %b %Y %H:%M:%S GMT+8')}), 405 return jsonify({"status": "405 Method Not Allowed", "timestamp": int(time.time()), "info": "You are using the wrong method. Check the docs.", "date": datetime.now(pytz.timezone('Asia/Shanghai')).strftime('%a, %d %b %Y %H:%M:%S GMT+8')}), 405
@app.errorhandler(400) @app.errorhandler(400)
def method_not_allowed(e): def bad_request(e):
return jsonify({"status": "400 Bad Request", "timestamp": int(time.time()), "info": "Something went Wrong.", "date": datetime.now(pytz.timezone('Asia/Shanghai')).strftime('%a, %d %b %Y %H:%M:%S GMT+8')}), 400 return jsonify({"status": "400 Bad Request", "timestamp": int(time.time()), "info": "Something went Wrong.", "date": datetime.now(pytz.timezone('Asia/Shanghai')).strftime('%a, %d %b %Y %H:%M:%S GMT+8')}), 400
@ -206,7 +206,7 @@ def music_post():
music(userId, music_data) music(userId, music_data)
returnCode = 200 returnCode = 200
status = "200 OK" status = "200 OK"
info = "Operation was Su." info = "Succeed."
log = {"UserLoginApiStatus": 1, "UploadUserPlaylogApiStatus": 1, "UpsertUserAllApi": 1,"UserLogoutApiStatus": 1} log = {"UserLoginApiStatus": 1, "UploadUserPlaylogApiStatus": 1, "UpsertUserAllApi": 1,"UserLogoutApiStatus": 1}
else: else:
returnCode = 500 returnCode = 500

View File

@ -374,11 +374,11 @@ def music(userId):
userall_result = json.loads(sdgb_api(data, "UpsertUserAllApi", userId)) userall_result = json.loads(sdgb_api(data, "UpsertUserAllApi", userId))
data = json.dumps( data = json.dumps({
login_result, "UserLogin": login_result,
userlog_result, "UserPlaylog": userlog_result,
userall_result "UpsertUserall": userall_result
) })
return data return data

View File

@ -638,11 +638,11 @@ def music(userId, music_data):
userall_result = json.loads(sdgb_api(data, "UpsertUserAllApi", userId)) userall_result = json.loads(sdgb_api(data, "UpsertUserAllApi", userId))
data = json.dumps( data = json.dumps({
login_result, "UserLogin": login_result,
userlog_result "UserPlaylog": userlog_result,
userall_result "UpsertUserall": userall_result
) })
return data return data