fix read html file code

This commit is contained in:
lan-air
2022-12-10 14:04:48 +08:00
parent 6bd7f31700
commit 6a04c0f11b
+2 -2
View File
@@ -18,8 +18,8 @@ app = FastAPI()
if not os.path.exists('./static'):
os.makedirs('./static')
app.mount("/static", StaticFiles(directory="static"), name="static")
index_html = open('templates/index.html', 'r').read()
admin_html = open('templates/admin.html', 'r').read()
index_html = open('templates/index.html', 'r', encoding='utf-8').read()
admin_html = open('templates/admin.html', 'r', encoding='utf-8').read()
# 过期时间
exp_hour = 24
# 允许错误次数