From 539819d47420a2c848203dc8541ee81882f5c397 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BF=A0=E6=9E=97?= <170083662@qq.com> Date: Mon, 31 Aug 2026 17:55:49 +0800 Subject: [PATCH] =?UTF-8?q?feat(system):=20=E6=94=AF=E6=8C=81=E8=87=AA?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=E9=A1=B5=E9=9D=A2=E4=B8=8E=E5=9C=BA=E6=99=AF?= =?UTF-8?q?=E5=80=BC=E8=8E=B7=E5=8F=96=E5=BE=AE=E4=BF=A1=E5=B0=8F=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改获取微信小程序码接口,新增page和scene参数支持自定义 - 优先使用传入的scene参数,兼容原订单核销逻辑 - 优先使用传入的page参数,兼容原订单核销页面 - 更新接口文档说明,明确支持数量极多的业务场景下小程序码获取 - 保持登录校验和访问令牌获取不变,确保接口安全性 --- .../common/system/controller/WxLoginController.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/gxwebsoft/common/system/controller/WxLoginController.java b/src/main/java/com/gxwebsoft/common/system/controller/WxLoginController.java index 2461193..634a4bc 100644 --- a/src/main/java/com/gxwebsoft/common/system/controller/WxLoginController.java +++ b/src/main/java/com/gxwebsoft/common/system/controller/WxLoginController.java @@ -965,17 +965,21 @@ public class WxLoginController extends BaseController { return fail("获取失败", null); } - @Operation(summary = "获取微信小程序码-订单核销码-数量极多的业务场景") + @Operation(summary = "获取微信小程序码-数量极多的业务场景(支持自定义页面与场景值)") @GetMapping("/getOrderQRCodeUnlimited/{orderNo}") - public ApiResult getOrderQRCodeUnlimited(@PathVariable("orderNo") String orderNo) { + public ApiResult getOrderQRCodeUnlimited(@PathVariable("orderNo") String orderNo, + @RequestParam(required = false) String page, + @RequestParam(required = false) String scene) { final User loginUser = getLoginUser(); if(loginUser == null){ return fail("请先登录"); } String apiUrl = "https://api.weixin.qq.com/wxa/getwxacodeunlimit?access_token=" + getAccessToken(loginUser.getTenantId()); final HashMap map = new HashMap<>(); - map.put("scene", "orderNo=".concat(orderNo)); - map.put("page", "package/admin/order-scan"); + // scene 优先用入参,否则回退兼容原订单核销逻辑:orderNo=xxx + map.put("scene", StrUtil.isNotBlank(scene) ? scene : "orderNo=".concat(orderNo)); + // page 优先用入参,否则回退兼容原订单核销页面 + map.put("page", StrUtil.isNotBlank(page) ? page : "package/admin/order-scan"); map.put("env_version", "trial"); // 获取图片 Buffer byte[] qrCode = HttpRequest.post(apiUrl)