【通用】验证码判断时忽略大小写

pull/241/head
俞宝山 2024-11-12 03:38:25 +08:00
parent 568c3301e0
commit c5d30b47d1
2 changed files with 2 additions and 2 deletions

View File

@ -156,7 +156,7 @@ public class AuthServiceImpl implements AuthService {
commonCacheOperator.remove(AUTH_VALID_CODE_CACHE_KEY + phoneOrEmail + StrUtil.UNDERLINE + validCodeReqNo); commonCacheOperator.remove(AUTH_VALID_CODE_CACHE_KEY + phoneOrEmail + StrUtil.UNDERLINE + validCodeReqNo);
} }
// 不一致则直接验证码错误 // 不一致则直接验证码错误
if (!validCode.equals(Convert.toStr(existValidCode).toLowerCase())) { if (!validCode.equalsIgnoreCase(Convert.toStr(existValidCode))) {
throw new CommonException("验证码错误"); throw new CommonException("验证码错误");
} }
} }

View File

@ -435,7 +435,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
commonCacheOperator.remove(USER_VALID_CODE_CACHE_KEY + phoneOrEmail + StrUtil.UNDERLINE + validCodeReqNo); commonCacheOperator.remove(USER_VALID_CODE_CACHE_KEY + phoneOrEmail + StrUtil.UNDERLINE + validCodeReqNo);
} }
// 不一致则直接验证码错误 // 不一致则直接验证码错误
if (!validCode.equals(Convert.toStr(existValidCode).toLowerCase())) { if (!validCode.equalsIgnoreCase(Convert.toStr(existValidCode))) {
throw new CommonException("验证码错误"); throw new CommonException("验证码错误");
} }
} }