From 510fb3814fbd72fcc8e4e39ba8ef0cfd59e2c3ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E4=B9=85=E5=93=A5?= <787952492@qq.com> Date: Fri, 24 Jun 2022 12:30:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E4=BF=A1=E7=99=BB=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/admin/auth/AuthController.java | 20 +++++++++++++++---- .../module/farm/annotation/FarmMsgAspect.java | 2 +- 2 files changed, 17 insertions(+), 5 deletions(-) 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 62d237a4..17b823ce 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 @@ -87,6 +87,8 @@ public class AuthController { private UserRoleMapper userRoleMapper; @Resource private PasswordEncoder passwordEncoder; + @Resource + private WxMaService wxMaService; @PostMapping("/login") @@ -106,10 +108,20 @@ public class AuthController { if ("wxcp".equals(dto.getCode())){ cpuser = cpUserService.getByUserId("test"); }else{ - //企业微信 - WxCpMaJsCode2SessionResult session = wxCpService.jsCode2Session(dto.getCode()); - log.info("企业微信登录信息:{}", session); - cpuser = cpUserService.getByUserId(session.getUserId()); + if (dto.getPlatform().equalsIgnoreCase("WX")){ + //普通微信 + WxMaJscode2SessionResult result = wxMaService.jsCode2SessionInfo(dto.getCode()); + log.info("微信登录信息,{}", result); + cpuser = cpUserService.getByUserId(result.getUnionid()); + if (ObjectUtil.isEmpty(cpuser)){ + cpuser = cpUserService.getByUserId("test"); + } + }else{ + //企业微信 + WxCpMaJsCode2SessionResult session = wxCpService.jsCode2Session(dto.getCode()); + log.info("企业微信登录信息:{}", session); + cpuser = cpUserService.getByUserId(session.getUserId()); + } } if (ObjectUtil.isEmpty(cpuser)){ diff --git a/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/annotation/FarmMsgAspect.java b/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/annotation/FarmMsgAspect.java index 2c6eff2f..f6f7fab7 100644 --- a/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/annotation/FarmMsgAspect.java +++ b/zsw-farm/zsw-farm-impl/src/main/java/cn/iocoder/yudao/module/farm/annotation/FarmMsgAspect.java @@ -146,7 +146,7 @@ public class FarmMsgAspect { message.setAppId(appid); message.setTitle(farmMsgDTO.getType().getDesc() + farmMsgDTO.getOperation().getDesc() + "通知"); message.setDescription(LocalDateTimeUtil.formatNormal(LocalDateTime.now())); - message.setPage(farmMsgDTO.getType().equals(FarmMsgTypeEnum.PROJECT) ? "pages/project/index" : "pages/task/index"); + message.setPage(farmMsgDTO.getType().equals(FarmMsgTypeEnum.PROJECT) ? "pages/project/index" : "pages/task/taskDetail/index?id="+ farmMsgDTO.getId()); Map map2 = new HashMap<>(); map2.put("发起人", createUser.getName());