From 579e969465105fcc007969c7e9b8c74f1b6434b2 Mon Sep 17 00:00:00 2001
From: jiangqs <jiangqs>
Date: 星期五, 09 六月 2023 18:12:29 +0800
Subject: [PATCH] 基础配置
---
ruoyi-auth/src/main/java/com/ruoyi/auth/controller/QwH5Controller.java | 9 +++++++--
1 files changed, 7 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 823ee4c..075f428 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,6 +10,7 @@
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;
@@ -35,6 +36,9 @@
@Autowired
private TokenService tokenService;
+ @Value("${h5.redirectUriBase}")
+ private String redirectUriBase;
+
/**
* 构造网页授权链接
@@ -46,6 +50,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));
@@ -66,8 +71,8 @@
@GetMapping("/h5/getAgentConfig")
@ApiOperation("通过code获取访问用户登录")
- public R<AgentConfigVo> getAgentConfig(@ApiParam(value = "url", required = true) String url) throws IOException {
- AgentConfigVo agentConfigVo = qywxInnerService.getAgentConfig(url);
+ public R<AgentConfigVo> getAgentConfig(@ApiParam(value = "url", required = true) String url, @ApiParam(value = "type", required = false) String type) throws IOException {
+ AgentConfigVo agentConfigVo = qywxInnerService.getAgentConfig(url, type);
return R.ok(agentConfigVo);
}
--
Gitblit v1.7.1