Skip to content

Commit 6fcd501

Browse files
author
lan-air
committed
update index return
1 parent b557b5e commit 6fcd501

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

main.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
if not os.path.exists('./static'):
1919
os.makedirs('./static')
2020
app.mount("/static", StaticFiles(directory="static"), name="static")
21+
index_html = open('templates/index.html', 'r').read()
2122
# 过期时间
2223
exp_hour = 24
2324
# 允许错误次数
@@ -58,7 +59,7 @@ def get_file_name(key, ext, file):
5859
@app.get('/')
5960
async def index():
6061
with open('templates/index.html', 'r') as f:
61-
return HTMLResponse(f.read())
62+
return HTMLResponse(index_html)
6263

6364

6465
@app.post('/')

0 commit comments

Comments
 (0)