fix(qrLogin): 修正二维码场景值传递问题

- 将 scene 参数由 "token=" + token 改为直接传 token
- 确保 scene 为字符串且长度不超过 32 字符
- 便于小程序端通过 router.params.scene 获取 token
- 优化注释说明二维码参数限制和使用方式
This commit is contained in:
2026-04-07 21:14:34 +08:00
parent f4e7e48254
commit 1c9c2dfd82

View File

@@ -138,7 +138,9 @@ public class QrLoginServiceImpl implements QrLoginService {
String apiUrl = "https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=" + accessToken;
HashMap<String, Object> params = new HashMap<>();
params.put("scene", "token=" + token); // 场景值,扫码后会透传
// scene 必须是字符串,最大 32 字符,直接传 token32位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); // 二维码宽度