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(