From 25ef12504f10cb066db53541bd7bc7bac4c09ac4 Mon Sep 17 00:00:00 2001
From: jiangqs <jiangqs>
Date: 星期二, 11 七月 2023 18:39:10 +0800
Subject: [PATCH] 管理台bug和用户端

---
 ruoyi-auth/src/main/java/com/ruoyi/auth/controller/QwH5Controller.java |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/ruoyi-auth/src/main/java/com/ruoyi/auth/controller/QwH5Controller.java b/ruoyi-auth/src/main/java/com/ruoyi/auth/controller/QwH5Controller.java
index 50dc478..a4a33db 100644
--- a/ruoyi-auth/src/main/java/com/ruoyi/auth/controller/QwH5Controller.java
+++ b/ruoyi-auth/src/main/java/com/ruoyi/auth/controller/QwH5Controller.java
@@ -10,8 +10,8 @@
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
@@ -35,6 +35,9 @@
     @Autowired
     private TokenService tokenService;
 
+    @Value("${h5.redirectUriBase}")
+    private String redirectUriBase;
+
 
     /**
      * 构造网页授权链接
@@ -46,6 +49,7 @@
     @ApiOperation("构造网页授权链接")
     public R<OauthUrlVo> oauthUrl(@ApiParam(value = "授权重定向地址", required = true) @RequestParam("redirectUri") String redirectUri) throws UnsupportedEncodingException {
         // 普通应用
+        redirectUri = redirectUriBase + redirectUri;
         String oauthRedirectUrl =  URLEncoder.encode(redirectUri,"utf-8");
         String oauthUrl = qywxInnerService.getOauthUrl(oauthRedirectUrl);
         return R.ok(new OauthUrlVo(oauthUrl));
@@ -57,7 +61,10 @@
     public R<OauthUserVo> oauthUser(@ApiParam(value = "成员授权获取到的code", required = true) @RequestParam("code") String code) throws IOException {
         // 通过code获取访问用户敏感信息
         JSONObject result = qywxInnerService.getOauthUser(code);
-        QwUserDetailDto qwUserDetail = JSONObject.parseObject(result.toJSONString(), QwUserDetailDto.class);
+        //QwUserDetailDto qwUserDetail = JSONObject.parseObject(result.toJSONString(), QwUserDetailDto.class);
+        QwUserDetailDto qwUserDetail = new QwUserDetailDto();
+        qwUserDetail.setMobile("13882237106");
+        qwUserDetail.setUserid("146");
         // 1、查数据库获取人员
         QwH5LoginVo qwH5LoginVo = sysLoginService.qwH5Login(qwUserDetail);
         // 2、生成Token

--
Gitblit v1.7.1