From 004c357153b9cbc11d769e567b11d19be48c79b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A3=B7=E5=8F=B6?= <14103883+leaf-phos@user.noreply.gitee.com> Date: Mon, 11 Nov 2024 09:04:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=A5=E9=94=99=E6=8F=90=E7=A4=BA=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/ruoyi/common/auth/wx/WxAuthService.java | 5 ++++- .../com/ruoyi/ss/user/service/impl/UserValidatorImpl.java | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/smart-switch-ruoyi/smart-switch-common/src/main/java/com/ruoyi/common/auth/wx/WxAuthService.java b/smart-switch-ruoyi/smart-switch-common/src/main/java/com/ruoyi/common/auth/wx/WxAuthService.java index bc16f720..2ac57c50 100644 --- a/smart-switch-ruoyi/smart-switch-common/src/main/java/com/ruoyi/common/auth/wx/WxAuthService.java +++ b/smart-switch-ruoyi/smart-switch-common/src/main/java/com/ruoyi/common/auth/wx/WxAuthService.java @@ -7,6 +7,7 @@ import com.alibaba.fastjson2.JSONObject; import com.ruoyi.common.config.WxConfig; import com.ruoyi.common.exception.ServiceException; import com.ruoyi.common.utils.http.HttpUtils; +import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -15,6 +16,7 @@ import org.springframework.stereotype.Service; * 2024/7/29 */ @Service +@Slf4j public class WxAuthService { @@ -54,7 +56,8 @@ public class WxAuthService { Integer errcode = body.getInteger("errcode"); if (errcode == null || !errcode.equals(0)) { - throw new ServiceException("获取手机号失败:" + body.getString("errmsg")); + log.error("获取手机号失败 {}", body); + throw new ServiceException("获取手机号失败"); } String phoneInfo = body.getString("phone_info"); diff --git a/smart-switch-service/src/main/java/com/ruoyi/ss/user/service/impl/UserValidatorImpl.java b/smart-switch-service/src/main/java/com/ruoyi/ss/user/service/impl/UserValidatorImpl.java index 8bee4937..09a2a054 100644 --- a/smart-switch-service/src/main/java/com/ruoyi/ss/user/service/impl/UserValidatorImpl.java +++ b/smart-switch-service/src/main/java/com/ruoyi/ss/user/service/impl/UserValidatorImpl.java @@ -107,7 +107,7 @@ public class UserValidatorImpl extends BaseValidator implements UserValidator { query.setEqPhonenumber(mobile); query.setExcludeUserId(userId); int repeatCount = userService.selectCount(query); - ServiceUtil.assertion(repeatCount > 0, "用户手机号重复"); + ServiceUtil.assertion(repeatCount > 0, "当前手机号已被绑定"); } @Override