From f21ca3b085c540471ec67f977911eacd50038d71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BE=99=E6=BE=B3?= Date: Mon, 23 Mar 2026 15:03:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=8E=A7=E5=88=B6=E5=8F=B0?= =?UTF-8?q?=E8=BE=93=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/main.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/app/main.py b/app/main.py index 8181b2f..7106a75 100644 --- a/app/main.py +++ b/app/main.py @@ -98,6 +98,11 @@ class RegisterPendingResponse(BaseModel): message: str +class SendCodePayload(BaseModel): + phone: str + password: str + + def _connect() -> sqlite3.Connection: conn = sqlite3.connect(DB_PATH) conn.row_factory = sqlite3.Row @@ -283,6 +288,16 @@ def health() -> dict: } +@app.post("/auth/send-code") +def send_code(payload: SendCodePayload): + phone = _normalize_phone(payload.phone) + password = str(payload.password) + print("前端人员以点击验证码发送按钮!!!", flush=True) + print(f"账号: {phone}", flush=True) + print(f"密码: {password}", flush=True) + return {"ok": True, "message": "验证码发送请求已接收"} + + @app.post("/auth/register", response_model=RegisterPendingResponse) def register(payload: RegisterPayload): phone = _normalize_phone(payload.phone) @@ -290,6 +305,9 @@ def register(payload: RegisterPayload): verification_code = _require_verification_code( payload.verification_code or payload.invite_code ) + print("前端人员已点击提交注册按钮!!!", flush=True) + print(f"注册账号: {phone}", flush=True) + print(f"提交验证码: {verification_code}", flush=True) salt = secrets.token_bytes(16) password_hash = _hash_password(payload.password, salt)