perf: Uvicorn bind template

This commit is contained in:
fit2cloud-chenyw
2025-04-28 15:24:05 +08:00
parent b009779c0e
commit 83769954bb
5 changed files with 20 additions and 4 deletions
+14 -1
View File
@@ -6,7 +6,20 @@ wlist = [
"/docs",
"/login/*",
"*.json",
"*.ico"
"*.ico",
"*.html",
"*.js",
"*.css",
"*.png",
"*.jpg",
"*.jpeg",
"*.gif",
"*.svg",
"*.woff",
"*.woff2",
"*.ttf",
"*.eot",
"*.otf"
]
class WhitelistChecker:
+3 -1
View File
@@ -1,3 +1,4 @@
from fastapi.staticfiles import StaticFiles
import sentry_sdk
from fastapi import FastAPI
from fastapi.routing import APIRoute
@@ -28,9 +29,10 @@ if settings.all_cors_origins:
allow_methods=["*"],
allow_headers=["*"],
)
app.add_middleware(TokenMiddleware)
app.include_router(api_router, prefix=settings.API_V1_STR)
app.mount("/", StaticFiles(directory='../frontend/dist'), name="static")
if __name__ == "__main__":
import uvicorn
uvicorn.run("main:app", host="0.0.0.0", port=8000, reload=True)
+1 -1
View File
@@ -1,2 +1,2 @@
VITE_API_BASE_URL=./
VITE_API_BASE_URL=./api/v1
VITE_APP_TITLE=SQLBot
+1
View File
@@ -19,6 +19,7 @@ export const watchRouter = (router: any) => {
return
}
if (to.path === '/login') {
console.log(from)
next('/chat')
} else {
next()
+1 -1
View File
@@ -167,7 +167,7 @@ const search = () => {
})
}
const addTerm = () => {
termApi.add(state.form).then((res: any) => {
termApi.add(state.form).then(() => {
dialogFormVisible.value = false
search()
ElMessage({