From 2aee013c86994f08f3c9d93271dcfc74c1a6683b Mon Sep 17 00:00:00 2001 From: liyj <1617420630@qq.com> Date: Fri, 19 Sep 2025 17:37:52 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E6=B6=88=E6=81=AF=E6=8E=A8?= =?UTF-8?q?=E9=80=81=E5=9B=9E=E8=B0=83=E6=8E=A5=E5=8F=A3=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../account/controller/mobile/WeiXinController.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/mall-account/src/main/java/com/suisung/mall/account/controller/mobile/WeiXinController.java b/mall-account/src/main/java/com/suisung/mall/account/controller/mobile/WeiXinController.java index 0c7bb886..e881a253 100644 --- a/mall-account/src/main/java/com/suisung/mall/account/controller/mobile/WeiXinController.java +++ b/mall-account/src/main/java/com/suisung/mall/account/controller/mobile/WeiXinController.java @@ -1,6 +1,7 @@ package com.suisung.mall.account.controller.mobile; import cn.hutool.json.JSONObject; +import cn.hutool.json.JSONUtil; import com.suisung.mall.account.service.AccountUserBindConnectService; import com.suisung.mall.account.service.WeiXinService; import com.suisung.mall.common.api.CommonResult; @@ -142,15 +143,16 @@ public class WeiXinController extends BaseControllerImpl { @ApiOperation(value = "小程序回调", notes = "小程序回调") - @RequestMapping(value = "/xcxCallBack") - public CommonResult xcxCallBack(@RequestBody JSONObject jsonObject, - @RequestParam("signature") String signature, + @RequestMapping(value = "/xcxCallBack", method = RequestMethod.GET) + public CommonResult xcxCallBack(@RequestParam("signature") String signature, @RequestParam("timestamp") String timestamp, - @RequestParam("nonce") String nonce) { + @RequestParam("nonce") String nonce, + @RequestParam("echostr") String echostr) { boolean checked=weiXinService.checkSignature(timestamp, nonce, signature); if(!checked){ return CommonResult.failed("校验失败"); } + JSONObject jsonObject= JSONUtil.parseObj(echostr); accountUserBindConnectService.bindTmplId(jsonObject); return CommonResult.success("小程序订阅消息模板绑定成功"); }