fix(qrLogin): 修正二维码场景值传递问题
- 将 scene 参数由 "token=" + token 改为直接传 token - 确保 scene 为字符串且长度不超过 32 字符 - 便于小程序端通过 router.params.scene 获取 token - 优化注释说明二维码参数限制和使用方式
This commit is contained in:
@@ -138,7 +138,9 @@ public class QrLoginServiceImpl implements QrLoginService {
|
|||||||
String apiUrl = "https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=" + accessToken;
|
String apiUrl = "https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=" + accessToken;
|
||||||
|
|
||||||
HashMap<String, Object> params = new HashMap<>();
|
HashMap<String, Object> 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("page", "pages/public/qr-confirm/index"); // 小程序确认页面路径
|
||||||
params.put("env_version", "release"); // 正式版小程序
|
params.put("env_version", "release"); // 正式版小程序
|
||||||
params.put("width", 280); // 二维码宽度
|
params.put("width", 280); // 二维码宽度
|
||||||
|
|||||||
Reference in New Issue
Block a user