From 0c9504a75b16311a7d06bbac199a7a0598ef9029 Mon Sep 17 00:00:00 2001 From: hurui <177768073@qq.com> Date: Sat, 6 Nov 2021 20:15:39 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/cweb/controller/pay/UnionPayController.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/hai-cweb/src/main/java/com/cweb/controller/pay/UnionPayController.java b/hai-cweb/src/main/java/com/cweb/controller/pay/UnionPayController.java index 4629f92c..e4098c3b 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/pay/UnionPayController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/pay/UnionPayController.java @@ -31,6 +31,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.BufferedOutputStream; import java.math.BigDecimal; +import java.net.URLDecoder; import java.util.*; @Controller @@ -88,7 +89,10 @@ public class UnionPayController { log.info(params); if (StringUtils.isNotBlank(params)) { - JSONObject body = JSONObject.parseObject(params.substring(0, params.length() - 1)); + // 参数解码 + String paramsStr = URLDecoder.decode(params,"utf-8"); + // 转换成JSON格式 + JSONObject body = JSONObject.parseObject(paramsStr.substring(0, paramsStr.length() - 1)); if (StringUtils.isNotBlank(body.getString("tradetrace"))) { // 查询订单信息 HighOrder order = highOrderService.getOrderByOrderNo(body.getString("tradetrace"));