From 1c9c2dfd82f48627130e0ab7357c8c16fa49800f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com> Date: Tue, 7 Apr 2026 21:14:34 +0800 Subject: [PATCH] =?UTF-8?q?fix(qrLogin):=20=E4=BF=AE=E6=AD=A3=E4=BA=8C?= =?UTF-8?q?=E7=BB=B4=E7=A0=81=E5=9C=BA=E6=99=AF=E5=80=BC=E4=BC=A0=E9=80=92?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将 scene 参数由 "token=" + token 改为直接传 token - 确保 scene 为字符串且长度不超过 32 字符 - 便于小程序端通过 router.params.scene 获取 token - 优化注释说明二维码参数限制和使用方式 --- .../com/gxwebsoft/auto/service/impl/QrLoginServiceImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/gxwebsoft/auto/service/impl/QrLoginServiceImpl.java b/src/main/java/com/gxwebsoft/auto/service/impl/QrLoginServiceImpl.java index 4876c48..9832787 100644 --- a/src/main/java/com/gxwebsoft/auto/service/impl/QrLoginServiceImpl.java +++ b/src/main/java/com/gxwebsoft/auto/service/impl/QrLoginServiceImpl.java @@ -138,7 +138,9 @@ public class QrLoginServiceImpl implements QrLoginService { String apiUrl = "https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=" + accessToken; HashMap params = new HashMap<>(); - params.put("scene", "token=" + token); // 场景值,扫码后会透传 + // scene 必须是字符串,最大 32 字符,直接传 token(32位UUID)刚好满足限制 + // 小程序端通过 router.params.scene 获取此 token + params.put("scene", token); params.put("page", "pages/public/qr-confirm/index"); // 小程序确认页面路径 params.put("env_version", "release"); // 正式版小程序 params.put("width", 280); // 二维码宽度