From 51830d153dfddf244d985b715731adf3ae173b1f Mon Sep 17 00:00:00 2001 From: dzq Date: Tue, 9 Dec 2025 10:31:44 +0800 Subject: [PATCH] =?UTF-8?q?fix(wx=E7=94=A8=E6=88=B7):=20=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E6=A3=80=E6=9F=A5=E9=98=B2=E6=AD=A2=E9=87=8D=E5=A4=8D=E7=BB=91?= =?UTF-8?q?=E5=AE=9A=E6=B1=87=E9=82=A6=E4=BA=91=E7=94=A8=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在绑定汇邦云用户时,增加检查逻辑防止多个微信用户绑定同一个汇邦云账号 --- .../agileboot/domain/wx/user/WxUserApplicationService.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/agileboot-domain/src/main/java/com/agileboot/domain/wx/user/WxUserApplicationService.java b/agileboot-domain/src/main/java/com/agileboot/domain/wx/user/WxUserApplicationService.java index ac922cf..89e486e 100644 --- a/agileboot-domain/src/main/java/com/agileboot/domain/wx/user/WxUserApplicationService.java +++ b/agileboot-domain/src/main/java/com/agileboot/domain/wx/user/WxUserApplicationService.java @@ -291,11 +291,18 @@ public class WxUserApplicationService { return false; } + // 查询汇邦云用户(通过身份证) Ab98UserEntity ab98UserEntity = ab98UserService.getByIdnum(command.getIdNum()); // 如果汇邦云用户存在且姓名匹配,则直接绑定 if (ab98UserEntity != null && StringUtils.equals(ab98UserEntity.getName(), command.getName())) { + // 检查是否有其他微信用户已经绑定了该ab98UserId + WxUserEntity existingWxUser = userService.getByAb98UserId(ab98UserEntity.getAb98UserId()); + if (existingWxUser != null) { + // 有其他微信用户已经绑定了该ab98UserId,直接抛出异常 + throw new IllegalArgumentException("该汇邦云用户已被其他微信用户绑定"); + } // 更新微信用户表的ab98UserId WxUserEntity wxUserEntity = userService.getByOpenid(openid); if (wxUserEntity != null) {