|
|
|
@ -1,5 +1,6 @@
@@ -1,5 +1,6 @@
|
|
|
|
|
package com.cloud.kicc.system.service.impl; |
|
|
|
|
|
|
|
|
|
import cn.hutool.core.convert.Convert; |
|
|
|
|
import cn.hutool.core.lang.Validator; |
|
|
|
|
import cn.hutool.core.map.MapUtil; |
|
|
|
|
import cn.hutool.core.text.CharSequenceUtil; |
|
|
|
@ -28,6 +29,7 @@ import org.springframework.transaction.annotation.Transactional;
@@ -28,6 +29,7 @@ import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
|
|
|
import java.util.Arrays; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Map; |
|
|
|
|
import java.util.Optional; |
|
|
|
|
import java.util.concurrent.TimeUnit; |
|
|
|
|
import java.util.stream.Collectors; |
|
|
|
@ -73,7 +75,7 @@ public class AppServiceImpl implements AppService {
@@ -73,7 +75,7 @@ public class AppServiceImpl implements AppService {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Transactional(rollbackFor = Exception.class) |
|
|
|
|
public SsoUser phoneRegister(String phone, String captcha, String identityProvider) { |
|
|
|
|
public Map<String, Object> phoneRegister(String phone, String captcha, String identityProvider) { |
|
|
|
|
// 设置不区分大小写,全部以小写验证
|
|
|
|
|
Validator.validateMobile(phone, "手机号码不合法"); |
|
|
|
|
String code = captcha.toLowerCase(); |
|
|
|
@ -105,7 +107,7 @@ public class AppServiceImpl implements AppService {
@@ -105,7 +107,7 @@ public class AppServiceImpl implements AppService {
|
|
|
|
|
.eq(SsoUser::getTenantId, initTenantId) |
|
|
|
|
.eq(SsoUser::getIdentityProvider, identityProvider)); |
|
|
|
|
if (!findSsoUser.isEmpty()) { |
|
|
|
|
return findSsoUser.get(0); |
|
|
|
|
return Convert.convert(Map.class, findSsoUser.get(0)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// 修改扩展用户信息
|
|
|
|
@ -151,7 +153,9 @@ public class AppServiceImpl implements AppService {
@@ -151,7 +153,9 @@ public class AppServiceImpl implements AppService {
|
|
|
|
|
|
|
|
|
|
// 处理原密码给到APP自动一键登陆
|
|
|
|
|
ssoUser.setPassword(initPassword); |
|
|
|
|
return ssoUser; |
|
|
|
|
Map result = Convert.convert(Map.class, findSsoUser.get(0)); |
|
|
|
|
result.put("register", true); |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|