mirror of https://gitee.com/xiaonuobase/snowy
【通用】验证码判断时忽略大小写
parent
568c3301e0
commit
c5d30b47d1
|
@ -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("验证码错误");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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("验证码错误");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue