From 4d6afae5590cd25427c330fbf88ff93409d0dfc4 Mon Sep 17 00:00:00 2001 From: satori Date: Sun, 10 Nov 2024 22:08:03 +0800 Subject: [PATCH] DEBUG --- models/mysql.py | 26 -------------------------- routers/img.py | 1 + 2 files changed, 1 insertion(+), 26 deletions(-) diff --git a/models/mysql.py b/models/mysql.py index da84b3b..218f912 100644 --- a/models/mysql.py +++ b/models/mysql.py @@ -19,29 +19,3 @@ pool = PooledDB( database=MYSQL_NAME, charset='utf8mb4' ) - -## 创建 MySQL 连接 -#def create_connection(): -# return pymysql.connect( -# host=MYSQL_HOST, -# user=MYSQL_USER, -# port=MYSQL_PORT, # 应该使用 MYSQL_PORT 而不是 MYSQL_HOST -# password=MYSQL_PASS, -# database=MYSQL_NAME, -# local_infile=True, -# cursorclass=pymysql.cursors.DictCursor -# ) -# -## 连接 MySQL (开启 MySQL 服务) -#conn = create_connection() -# -## 获取 MySQL 连接 -#def get_cursor(): -# global conn -# try: -# conn.ping() -# return conn.cursor() -# except Exception: -# conn = create_connection() -# return conn.cursor() -# \ No newline at end of file diff --git a/routers/img.py b/routers/img.py index 1effd2c..105b6e7 100644 --- a/routers/img.py +++ b/routers/img.py @@ -72,6 +72,7 @@ def get_image_type_thumbnail(type:str, id:str, version:str, n:int, w:int, ext:st if user is None: print('用户不存在:', count) return Response('用户不存在', status_code=404) + print("user:", user) url = user['avatar'] else: print('图片类型不存在:', type)