From c66d1303efa65277bee7edefb98aff0dc724efef Mon Sep 17 00:00:00 2001 From: Milky0217 Date: Fri, 24 Apr 2026 10:56:33 +0800 Subject: [PATCH] =?UTF-8?q?fix(auth):=20=E7=BB=9F=E4=B8=80=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E7=A0=81=E5=8F=82=E6=95=B0=E5=90=8D=E4=B8=BA=20code?= =?UTF-8?q?=EF=BC=88=E4=B8=8E=E5=89=8D=E7=AB=AF=E4=BF=9D=E6=8C=81=E4=B8=80?= =?UTF-8?q?=E8=87=B4=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/handlers/auth.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/handlers/auth.rs b/src/handlers/auth.rs index ab1a22b..4d5f240 100644 --- a/src/handlers/auth.rs +++ b/src/handlers/auth.rs @@ -447,11 +447,11 @@ pub async fn web_generate_login_code( /// 确认网页端登录(小程序调用) /// POST /api/web-login/confirm -/// Body: { short_code: string } +/// Body: { code: string } /// 后端查询登录码,找到了就生成 JWT,更新 token 字段,删除登录码 #[derive(Debug, Deserialize)] pub struct WebLoginConfirmRequest { - pub short_code: String, + pub code: String, } /// 确认登录响应 @@ -469,7 +469,7 @@ pub async fn web_login_confirm( req: web::Json, app_state: web::Data, ) -> impl Responder { - let short_code = req.short_code.trim(); + let short_code = req.code.trim(); // 查找登录码(模糊匹配,因为存入的是 ASD-XXXXXX 格式) let record: Option<(String, String, chrono::DateTime, Option)> = sqlx::query_as(