数据库接口重构

This commit is contained in:
2024-04-15 15:19:56 +08:00
parent 372435d224
commit 79beba473e
7 changed files with 90 additions and 44 deletions

View File

@@ -1,6 +1,6 @@
from flask import *
from flask import Blueprint
import db, file
import db.file , file
api_Img_bp = Blueprint("api_Img_bp", __name__)
@@ -9,7 +9,7 @@ api_Img_bp = Blueprint("api_Img_bp", __name__)
def img(bookid, index): # 图片接口
if request.cookies.get("islogin") is None:
return abort(403)
if db.searchByid(bookid) == "":
if db.file.searchByid(bookid) == "":
return abort(404)
# 设置响应类型为图片
data, filename = file.raedZip(bookid, index)