Commit 14d5a277 authored by jiaorz's avatar jiaorz

Merge branch 'master-captcha-branch' into dev

parents 7c86b335 4056af43
......@@ -57,9 +57,14 @@ public class CaptchaController {
captchaBaseParam.setUrlOrPath(ImageUtils.getClickWordBgPath());
captcha.setFontColorRandom(false);
ClickWordCaptchaVO dataVO = (ClickWordCaptchaVO) captcha.create(captchaBaseParam);
log.info("获取注册验证码:》》》{}", dataVO.getPointList());
if (dataVO.getPointList() != null) {
try {
String redisLockKey = RedisKey.CAPTCHA_PHONE_PREFIX + phone;
String captchaCode = redisTemplate.opsForValue().get(redisLockKey) == null ? "" : redisTemplate.opsForValue().get(redisLockKey).toString();
if (StringUtils.isNotBlank(captchaCode)) {
redisTemplate.delete(redisLockKey);
}
Boolean suc = redisTemplate.opsForValue().setIfAbsent(redisLockKey, JSONArray.toJSONString(dataVO.getPointList()));
if (suc) {
redisTemplate.expire(redisLockKey, 5, TimeUnit.MINUTES);//5分钟内过期
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment