From 73877d675a9784fefa220900cabeba0f9e21be0a Mon Sep 17 00:00:00 2001 From: Loki <654612@qq.com> Date: Mon, 23 May 2022 14:14:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95=E5=BE=AE=E4=BF=A1=E7=99=BB?= =?UTF-8?q?=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/cn/iocoder/yudao/config/WxCpConfigure.java | 8 ++++++++ .../system/controller/admin/auth/AuthController.java | 6 ++++++ yudao-ui-admin | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/yudao-framework/yudao-spring-boot-starter-biz-weixin/src/main/java/cn/iocoder/yudao/config/WxCpConfigure.java b/yudao-framework/yudao-spring-boot-starter-biz-weixin/src/main/java/cn/iocoder/yudao/config/WxCpConfigure.java index 3301f96e..5885862e 100644 --- a/yudao-framework/yudao-spring-boot-starter-biz-weixin/src/main/java/cn/iocoder/yudao/config/WxCpConfigure.java +++ b/yudao-framework/yudao-spring-boot-starter-biz-weixin/src/main/java/cn/iocoder/yudao/config/WxCpConfigure.java @@ -4,17 +4,25 @@ import lombok.extern.slf4j.Slf4j; import me.chanjar.weixin.cp.api.WxCpService; import me.chanjar.weixin.cp.api.impl.WxCpServiceImpl; import me.chanjar.weixin.cp.config.impl.WxCpDefaultConfigImpl; +import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Scope; @Configuration @Slf4j public class WxCpConfigure { + @Value("${corpId}") + private String corpId; + private String farmAppid; + private String farmSecret; @Bean + @Scope("singleton") public WxCpService wxCpService(){ + log.info("333:{}",corpId); WxCpDefaultConfigImpl config = new WxCpDefaultConfigImpl(); config.setCorpId("wwb9f9734e8e124761"); diff --git a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java index 4227647c..5df142ba 100644 --- a/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java +++ b/yudao-module-system/yudao-module-system-impl/src/main/java/cn/iocoder/yudao/module/system/controller/admin/auth/AuthController.java @@ -29,6 +29,7 @@ import me.chanjar.weixin.common.error.WxErrorException; import me.chanjar.weixin.cp.api.WxCpService; import me.chanjar.weixin.cp.bean.WxCpMaJsCode2SessionResult; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; @@ -65,6 +66,10 @@ public class AuthController { @Resource private WxCpService wxCpService; + + @Value("${farm_secret}") + private String farmSecret; + @PostMapping("/login") @ApiOperation("使用账号密码登录") @OperateLog(enable = false) // 避免 Post 请求被记录操作日志 @@ -77,6 +82,7 @@ public class AuthController { @PostMapping("/loginByCp") @ApiOperation("微信小程序登录") public CommonResult loginByMxApp(String code) throws WxErrorException { + log.info("farmSecret:{}",farmSecret); // 企业微信登录 CpUserDO cpuser; if ("zhanyonghui".equals(code)){ diff --git a/yudao-ui-admin b/yudao-ui-admin index 8db432a7..940f54e8 160000 --- a/yudao-ui-admin +++ b/yudao-ui-admin @@ -1 +1 @@ -Subproject commit 8db432a76334b37b1a9c20fb16287fd0c9e57fe0 +Subproject commit 940f54e876f1c6ccc6e239c5990d34e83fb02b78