mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-20 02:55:04 +08:00
新增通用验证码
This commit is contained in:
@@ -134,10 +134,18 @@ public class MemberService {
|
||||
if (StringUtils.isEmpty(captchaCode)) {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_VERIFICATION_CODE_TIMEOUT_ERROR);
|
||||
}
|
||||
// 如果缓存中有,但与实际不一致,则为验证码错误
|
||||
if (!StringUtils.equals(captchaCode, dto.getVerificationCode())) {
|
||||
// 获取通用验证码
|
||||
String commonCaptchaCode = redisCache.getCacheObject(CacheConstants.SMS_COMMON_VERIFICATION_CODE_KEY + dto.getMobileNumber());
|
||||
|
||||
// 缓存中的验证码或者通用验证码, 两个都不匹配, 则抛出异常
|
||||
if (!StringUtils.equals(captchaCode, dto.getVerificationCode()) && !StringUtils.equals(commonCaptchaCode, dto.getVerificationCode())) {
|
||||
throw new BusinessException(ReturnCodeEnum.CODE_VERIFICATION_CODE_ERROR);
|
||||
}
|
||||
|
||||
// 如果缓存中有,但与实际不一致,则为验证码错误
|
||||
// if (!StringUtils.equals(captchaCode, dto.getVerificationCode())) {
|
||||
// throw new BusinessException(ReturnCodeEnum.CODE_VERIFICATION_CODE_ERROR);
|
||||
// }
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -292,6 +292,30 @@ public class SpringBootTestController {
|
||||
@Autowired
|
||||
private QcyunsService qcyunsService;
|
||||
|
||||
@Test
|
||||
public void testCommonVerificationCode() {
|
||||
String phoneNumber = "18612341234";
|
||||
String code = "2563";
|
||||
|
||||
// 改为保存redis
|
||||
// String redisKey = CacheConstants.SMS_VERIFICATION_CODE_KEY + phoneNumber;
|
||||
// redisCache.setCacheObject(redisKey, code, CacheConstants.cache_expire_time_10m);
|
||||
// // 新增一个通用验证码 2025年4月14日14点23分个别手机号无法收到验证码, 新增通用验证码
|
||||
// String redisKey2 = CacheConstants.SMS_COMMON_VERIFICATION_CODE_KEY + phoneNumber;
|
||||
// redisCache.setCacheObject(redisKey2, Constants.COMMON_VERIFICATION_CODE, CacheConstants.cache_expire_time_30m);
|
||||
//
|
||||
// MemberRegisterAndLoginDTO build = MemberRegisterAndLoginDTO.builder()
|
||||
// .mobileNumber(phoneNumber)
|
||||
// .verificationCode("2561")
|
||||
// .build();
|
||||
//
|
||||
// memberService.checkVerificationCode(build);
|
||||
|
||||
System.out.println(true && false);
|
||||
|
||||
System.out.println(false && false);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void verifySplitConfigTest() {
|
||||
List<StationSplitConfig> stationSplitConfigList = Lists.newArrayList();
|
||||
|
||||
@@ -1,32 +1,29 @@
|
||||
002212025033120040710752753296222404608
|
||||
002212025040118083910753086624879816704
|
||||
002212025040118121310753087526303617024
|
||||
002212025040210493010753338498696753152
|
||||
002212025040212040610753357272238116864
|
||||
002212025040215455710753413101593972736
|
||||
002212025040218145710753450600974405632
|
||||
002212025040219495110753474482596904960
|
||||
002212025040223032810753523208355823616
|
||||
002212025040223543110753536054248128512
|
||||
002212025040312071510753720452197171200
|
||||
002212025040314331710753757201870016512
|
||||
002212025040316411610753789412328382464
|
||||
002212025040421013510754217311242010624
|
||||
002212025040519095410754551590926077952
|
||||
002212025040609135610754764000301273088
|
||||
002212025040611093710754793114936659968
|
||||
002212025040619292810754918905612455936
|
||||
002212025040713134910755186758379012096
|
||||
002212025040717495610755256244689645568
|
||||
002212025040720410110755299299038371840
|
||||
002212025040819433910755647248230109184
|
||||
002212025040820210010755656648563867648
|
||||
002212025040910053110755864145792385024
|
||||
002212025040912384610755902710423265280
|
||||
002212025040917575410755983024773582848
|
||||
002212025040918160910755987617166602240
|
||||
002212025040922292610756051356562411520
|
||||
002212025041018274910756352943126425600
|
||||
002212025041020451410756387522530336768
|
||||
002212025041108534410756570855605174272
|
||||
002212025041112061610756619309433913344
|
||||
002212025040517302410754526554035269632
|
||||
002212025040521352610754588215047827456
|
||||
002212025040521583710754594050836094977
|
||||
002212025040522064510754596098677391360
|
||||
002212025040522423310754605107544899584
|
||||
002212025040522455910754605969921523712
|
||||
002212025040523390210754619322947743744
|
||||
002212025040600303910754632313055567872
|
||||
002212025040600392710754634527276048384
|
||||
002212025040601060810754641239708884992
|
||||
002212025040601173210754644110103003136
|
||||
002212025040603200310754674940574154752
|
||||
002212025040609192510754765380371595264
|
||||
002212025040609305410754768271103414272
|
||||
002212025040610013710754776001338265600
|
||||
002212025040612155610754809803494293504
|
||||
002212025040612343810754814508381392896
|
||||
002212025040612554310754819815291432960
|
||||
002212025040614060610754837526614802432
|
||||
002212025040615114510754854048968069120
|
||||
002212025040617230610754887101996191744
|
||||
002212025040617282410754888436151406592
|
||||
002212025040618070510754898171150368768
|
||||
002212025040619341410754920104559325184
|
||||
002212025040619431310754922363885764608
|
||||
002212025040619494510754924008057954304
|
||||
002212025040620043410754927737400930304
|
||||
002212025040620182910754931240679227392
|
||||
002212025040620585810754941429015732225
|
||||
|
||||
Reference in New Issue
Block a user