From ca9379564103da710dfb653a20e03c6ef2e66f5c Mon Sep 17 00:00:00 2001 From: clunt Date: Mon, 31 Oct 2022 09:04:04 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E6=8E=88=E6=9D=83?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=96=B0=E5=A2=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ghy/web/controller/tool/WxController.java | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/ghy-admin/src/main/java/com/ghy/web/controller/tool/WxController.java b/ghy-admin/src/main/java/com/ghy/web/controller/tool/WxController.java index 88abe364..ef5c4a67 100644 --- a/ghy-admin/src/main/java/com/ghy/web/controller/tool/WxController.java +++ b/ghy-admin/src/main/java/com/ghy/web/controller/tool/WxController.java @@ -6,6 +6,7 @@ import com.ghy.common.core.controller.BaseController; import com.ghy.common.core.domain.AjaxResult; import com.ghy.common.exception.ServiceException; import com.ghy.common.utils.ExceptionUtil; +import com.ghy.common.utils.StringUtils; import com.ghy.common.utils.WxUtils; import com.ghy.common.utils.http.HttpUtils; import com.ghy.customer.domain.Customer; @@ -111,6 +112,22 @@ public class WxController extends BaseController { } } + @GetMapping("/token/code") + @ResponseBody + public JSONObject tokenCode(HttpServletRequest request) throws IOException{ + JSONObject wxUser = WxUtils.getOpenid(request.getParameter("code"), "wx404f2439a8c24e15", "49ade04a817067fe2d65ab2f17afce75"); + String openId = wxUser.getString("openid"); + if(StringUtils.isNotEmpty(openId)){ + String questionUrl = "https://www.opsoul.com:8883/exam/question/details/list/"; + JSONObject result = new JSONObject(); + result.put("data", HttpUtils.sendGet(questionUrl + openId)); + result.put("openid", openId); + return result; + }else { + return null; + } + } + @GetMapping("/auth/phone") @ResponseBody public AjaxResult authPhone(HttpServletRequest request){ @@ -155,7 +172,7 @@ public class WxController extends BaseController { @ResponseBody public String openId(HttpServletRequest request) throws Exception { String code = request.getParameter("code"); - JSONObject wxUser = WxUtils.getOpenid(code, wxConfig.getAppId(), wxConfig.getSecret()); + JSONObject wxUser = WxUtils.getOpenid(code, "wx404f2439a8c24e15", "49ade04a817067fe2d65ab2f17afce75"); return wxUser.getString("openid"); } From dac9bad4045d789471dcc782ad1ce4f5350f54c8 Mon Sep 17 00:00:00 2001 From: clunt Date: Tue, 1 Nov 2022 09:43:23 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E6=8E=88=E6=9D=83?= =?UTF-8?q?=E6=8E=A5=E5=8F=A3=E6=96=B0=E5=A2=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ghy-admin/src/main/resources/application.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ghy-admin/src/main/resources/application.yaml b/ghy-admin/src/main/resources/application.yaml index 2406a3d8..1606c6e6 100644 --- a/ghy-admin/src/main/resources/application.yaml +++ b/ghy-admin/src/main/resources/application.yaml @@ -64,9 +64,9 @@ spring: servlet: multipart: # 单个文件大小 - max-file-size: 50MB + max-file-size: 200MB # 设置总上传的文件大小 - max-request-size: 100MB + max-request-size: 200MB # 服务模块 devtools: restart: