mirror of
https://github.com/Xtao-Labs/Geetest_Login_Page.git
synced 2024-11-16 04:45:22 +00:00
22 lines
552 B
Python
22 lines
552 B
Python
|
from fastapi import FastAPI, Query
|
||
|
from fastapi.responses import HTMLResponse
|
||
|
from html_temp import CHALLENGE_HTML
|
||
|
|
||
|
app = FastAPI()
|
||
|
|
||
|
|
||
|
@app.get('/', response_class=HTMLResponse)
|
||
|
async def challenge_page(
|
||
|
*,
|
||
|
username: str = Query(..., title="username"),
|
||
|
gt: str = Query(..., title="gt"),
|
||
|
challenge: str = Query(..., title="challenge")
|
||
|
):
|
||
|
return CHALLENGE_HTML.format(gt, challenge, username)
|
||
|
|
||
|
|
||
|
@app.get("/gt.js", response_class=HTMLResponse)
|
||
|
async def gt():
|
||
|
with open("gt.js", "r", encoding="utf-8") as f:
|
||
|
return f.read()
|