(data: LoginData)
| 50 | |
| 51 | @admin_api.post("/login") |
| 52 | async def login(data: LoginData): |
| 53 | if not verify_password(data.password, settings.admin_token): |
| 54 | raise HTTPException(status_code=401, detail="密码错误") |
| 55 | |
| 56 | token = create_token({"is_admin": True}) |
| 57 | return APIResponse(detail={"token": token, "token_type": "Bearer"}) |
| 58 | |
| 59 | |
| 60 | @admin_api.get("/verify") |
nothing calls this directly
no test coverage detected