From 6a04c0f11b3f083b0f606cdfc8929591d549bd3c Mon Sep 17 00:00:00 2001 From: lan-air Date: Sat, 10 Dec 2022 14:04:48 +0800 Subject: [PATCH] fix read html file code --- main.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 48ed907..913bffe 100644 --- a/main.py +++ b/main.py @@ -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 # 允许错误次数