oauth-手机号注册-dev环境放开校验手机号格式

This commit is contained in:
2022-12-05 15:45:56 +08:00
parent f9cd7ceaff
commit 8e5e0b9cef

View File

@@ -33,6 +33,7 @@ import com.google.gson.Gson;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jms.core.JmsTemplate; import org.springframework.jms.core.JmsTemplate;
import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Async;
import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.core.userdetails.UserDetails;
@@ -51,6 +52,8 @@ import java.util.Optional;
@Slf4j @Slf4j
public class MyUserDetailsServiceImpl implements MyUserDetailsService { public class MyUserDetailsServiceImpl implements MyUserDetailsService {
@Value("spring.profiles.active:dev")
private String activeProfile;
@Autowired @Autowired
private JedisService jedisService; private JedisService jedisService;
@Autowired @Autowired
@@ -109,7 +112,7 @@ public class MyUserDetailsServiceImpl implements MyUserDetailsService {
throws Exception { throws Exception {
Account account = null; Account account = null;
log.info("phone:{}, phoneAreaCode:{}, smsCode:{}, deviceInfo:{}, ipAddress:{}",phone,phoneAreaCode,smsCode,deviceInfo,ipAddress); log.info("phone:{}, phoneAreaCode:{}, smsCode:{}, deviceInfo:{}, ipAddress:{}",phone,phoneAreaCode,smsCode,deviceInfo,ipAddress);
if (CommonUtil.checkPhoneFormat(phoneAreaCode,phone)) { if (CommonUtil.checkPhoneFormat(phoneAreaCode,phone) || "dev".equals(activeProfile)) {
account = accountManageService.getOrGenAccountByPhone(phone,phoneAreaCode,smsCode,deviceInfo,ipAddress); account = accountManageService.getOrGenAccountByPhone(phone,phoneAreaCode,smsCode,deviceInfo,ipAddress);
} else if (CommonUtil.checkNumberOnly(phone)) { } else if (CommonUtil.checkNumberOnly(phone)) {
account = accountService.getAccountByErBanNo(Long.valueOf(phone)); account = accountService.getAccountByErBanNo(Long.valueOf(phone));