用户登录问题修改

This commit is contained in:
jiang 2024-11-12 11:07:51 +08:00
parent 5ce48ab5a1
commit 3bca31a748
1 changed files with 3 additions and 2 deletions

View File

@ -3,6 +3,7 @@ package com.bonus.auth.service;
import com.bonus.common.core.constant.SecurityConstants; import com.bonus.common.core.constant.SecurityConstants;
import com.bonus.common.core.domain.R; import com.bonus.common.core.domain.R;
import com.bonus.common.core.exception.ServiceException; import com.bonus.common.core.exception.ServiceException;
import com.bonus.common.core.utils.encryption.Sm4Utils;
import com.bonus.common.security.service.EmailService; import com.bonus.common.security.service.EmailService;
import com.bonus.common.security.service.SmsService; import com.bonus.common.security.service.SmsService;
import com.bonus.config.SystemConfig; import com.bonus.config.SystemConfig;
@ -43,7 +44,7 @@ public class RegisterVerificationCodeSender implements VerificationCodeStrategy
if (!systemConfig.getRegistersConfig().isEmailRegisters()) { if (!systemConfig.getRegistersConfig().isEmailRegisters()) {
throw new ServiceException("请输入正确的联系方式"); throw new ServiceException("请输入正确的联系方式");
} }
R<LoginUser> userResult = remoteUserService.getUserInfoByEmail(contactInfo, SecurityConstants.INNER); R<LoginUser> userResult = remoteUserService.getUserInfoByEmail(Sm4Utils.encrypt(contactInfo) , SecurityConstants.INNER);
if (userResult.getData() != null) { if (userResult.getData() != null) {
throw new ServiceException("联系方式已经注册账号"); throw new ServiceException("联系方式已经注册账号");
} }
@ -52,7 +53,7 @@ public class RegisterVerificationCodeSender implements VerificationCodeStrategy
if (!systemConfig.getRegistersConfig().isPhoneRegisters()) { if (!systemConfig.getRegistersConfig().isPhoneRegisters()) {
throw new ServiceException("请输入正确的联系方式"); throw new ServiceException("请输入正确的联系方式");
} }
R<LoginUser> userResult = remoteUserService.getUserInfoByPhone(contactInfo, SecurityConstants.INNER); R<LoginUser> userResult = remoteUserService.getUserInfoByPhone(Sm4Utils.encrypt(contactInfo), SecurityConstants.INNER);
if (userResult.getData() != null) { if (userResult.getData() != null) {
throw new ServiceException("联系方式已经注册账号"); throw new ServiceException("联系方式已经注册账号");
} }