fix(WxLoginController): 修正 getOrderQRCodeUnlimited 接口 scene 参数逻辑
- 调整 scene 参数优先级为:显式 scene > 自定义页面使用原始 orderNo > 兼容原订单核销 scene=orderNo=xxx - 当传入页面参数时,scene 直接使用原始 orderNo,满足小程序端 options.scene 读取需求 - page 参数无传入时默认设置为 package/admin/order-scan,保持兼容旧版订单核销页面 - 保证原有订单核销逻辑和接口调用行为向下兼容无影响
This commit is contained in:
@@ -980,8 +980,18 @@ public class WxLoginController extends BaseController {
|
||||
}
|
||||
String apiUrl = "https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=" + getAccessToken(loginUser.getTenantId());
|
||||
final HashMap<String, Object> map = new HashMap<>();
|
||||
// scene 优先用入参,否则回退兼容原订单核销逻辑:orderNo=xxx
|
||||
map.put("scene", StrUtil.isNotBlank(scene) ? scene : "orderNo=".concat(orderNo));
|
||||
// scene 优先级:显式 scene > 自定义页面用原始 orderNo > 兼容原订单核销(orderNo=xxx)
|
||||
String sceneValue;
|
||||
if (StrUtil.isNotBlank(scene)) {
|
||||
sceneValue = scene;
|
||||
} else if (StrUtil.isNotBlank(page)) {
|
||||
// 自定义页面场景:小程序端通过 options.scene 直接读取业务值(如活动/订单号)
|
||||
sceneValue = orderNo;
|
||||
} else {
|
||||
// 兼容原订单核销场景:scene=orderNo=xxx,默认跳转 package/admin/order-scan
|
||||
sceneValue = "orderNo=".concat(orderNo);
|
||||
}
|
||||
map.put("scene", sceneValue);
|
||||
// page 优先用入参,否则回退兼容原订单核销页面
|
||||
map.put("page", StrUtil.isNotBlank(page) ? page : "package/admin/order-scan");
|
||||
map.put("env_version", "trial");
|
||||
|
||||
Reference in New Issue
Block a user