新增icon

This commit is contained in:
高子兴 2024-10-26 17:26:52 +08:00
parent 37ac030f9e
commit 9bbeb4f618
2 changed files with 6 additions and 1 deletions

BIN
html/favicon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

View File

@ -1,5 +1,5 @@
from fastapi import FastAPI, WebSocket, WebSocketDisconnect, UploadFile, File from fastapi import FastAPI, WebSocket, WebSocketDisconnect, UploadFile, File
from fastapi.responses import StreamingResponse, HTMLResponse from fastapi.responses import StreamingResponse, HTMLResponse, FileResponse
from base64 import b64encode from base64 import b64encode
from openai import OpenAI from openai import OpenAI
from os.path import isfile from os.path import isfile
@ -114,3 +114,8 @@ async def test():
async def test(): async def test():
with open("html/index.html", "r", encoding="utf-8") as f: with open("html/index.html", "r", encoding="utf-8") as f:
return f.read() return f.read()
@app.get("/favicon.ico", response_class=FileResponse)
async def favicon():
return FileResponse("html/favicon.ico")