From 2902b235f63da79b9076a4139db959ea626a395d Mon Sep 17 00:00:00 2001 From: erzhongxmu Date: Fri, 24 Feb 2023 16:44:48 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=AC=E7=94=A8=E5=9B=9E=E8=B0=83=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/zzjee/api/ApiController.java | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/zzjee/api/ApiController.java b/src/main/java/com/zzjee/api/ApiController.java index e4b5fe5f..a34167ab 100644 --- a/src/main/java/com/zzjee/api/ApiController.java +++ b/src/main/java/com/zzjee/api/ApiController.java @@ -457,8 +457,30 @@ public class ApiController { public AjaxJson callback( HttpServletRequest request, HttpServletResponse response) { AjaxJson j = new AjaxJson(); - String code=request.getParameter("code"); - System.out.println(code+"************"); + try{ + String code=request.getParameter("code"); + System.out.println(code+"************"); + }catch (Exception e){ + e.printStackTrace(); + } + + + Map map = new HashMap(); + Enumeration paramNames = request.getParameterNames(); + while (paramNames.hasMoreElements()) { + String paramName = (String) paramNames.nextElement(); + + String[] paramValues = request.getParameterValues(paramName); + if (paramValues.length == 1) { + String paramValue = paramValues[0]; + if (paramValue.length() != 0) { + System.out.println("参数:" + paramName + "=" + paramValue); + map.put(paramName, paramValue); + } + } + } + + return j; } }