refactor: 更新主应用和依赖
- 在主应用中注册认证路由 - 更新requirements.txt添加认证相关依赖(jose, passlib, bcrypt)
This commit is contained in:
@@ -11,7 +11,7 @@ from fastapi.middleware.cors import CORSMiddleware
|
||||
load_dotenv()
|
||||
|
||||
from database import init_db
|
||||
from routers import websocket, chapters, books, conversations
|
||||
from routers import websocket, chapters, books, conversations, auth
|
||||
|
||||
# 初始化数据库
|
||||
init_db()
|
||||
@@ -28,6 +28,7 @@ app.add_middleware(
|
||||
)
|
||||
|
||||
# 注册路由
|
||||
app.include_router(auth.router) # 认证路由(放在最前面)
|
||||
app.websocket("/ws/conversation/{conversation_id}")(websocket.websocket_endpoint)
|
||||
app.include_router(conversations.router)
|
||||
app.include_router(chapters.router)
|
||||
|
||||
Reference in New Issue
Block a user