|
|
|
@ -23,6 +23,7 @@ import org.springframework.stereotype.Service;
@@ -23,6 +23,7 @@ import org.springframework.stereotype.Service;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
|
|
|
|
|
|
import java.util.Arrays; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Optional; |
|
|
|
|
import java.util.concurrent.TimeUnit; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
@ -68,7 +69,7 @@ public class AppServiceImpl implements AppService {
@@ -68,7 +69,7 @@ public class AppServiceImpl implements AppService {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
|
public SsoUser phoneRegister(String phone, String captcha, String identityProvider) { |
|
|
|
|
public SsoUser phoneRegister(String phone, String captcha, String identityProvider, String tenantId) { |
|
|
|
|
// 设置不区分大小写,全部以小写验证
|
|
|
|
|
Validator.validateMobile(phone, "手机号码不合法"); |
|
|
|
|
String code = captcha.toLowerCase(); |
|
|
|
@ -81,8 +82,13 @@ public class AppServiceImpl implements AppService {
@@ -81,8 +82,13 @@ public class AppServiceImpl implements AppService {
|
|
|
|
|
if (ObjectUtil.isEmpty(codeObj) || !code.equals(codeObj)) { |
|
|
|
|
throw new ValidateCodeException("验证码不合法"); |
|
|
|
|
} |
|
|
|
|
if (iSsoUserService.count(Wrappers.<SsoUser>lambdaQuery().eq(SsoUser::getPhone, phone)) > 0) { |
|
|
|
|
throw new ValidateCodeException("当前用户已经注册,不能重复注册"); |
|
|
|
|
|
|
|
|
|
List<SsoUser> findSsoUser = iSsoUserService.list(Wrappers.<SsoUser>lambdaQuery() |
|
|
|
|
.eq(SsoUser::getPhone, phone) |
|
|
|
|
.eq(SsoUser::getTenantId, tenantId) |
|
|
|
|
.eq(SsoUser::getIdentityProvider, identityProvider)); |
|
|
|
|
if (!findSsoUser.isEmpty()) { |
|
|
|
|
return findSsoUser.get(0); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 进行注册用户
|
|
|
|
|