from fastapi import APIRouter, Depends, HTTPException, Request router = APIRouter(prefix="/test", tags=["test"]) @router.get("/index") async def test(req: Request,current_user: User = Depends(get_current_user)): return {"message": "test","code":200}