Merge remote-tracking branch 'origin/leng_dev' into leng_dev

This commit is contained in:
冷冷 committed 2019-08-16 22:52:32 +08:00
commit 12277fb0a7
2 files changed
+4 -3

No files matched your search

@@ -43,7 +43,7 @@ public abstract class AbstractAuthenticationFailureEvenHandler implements Applic
}
/**
* 处理登录成功方法
* 处理登录失败方法
* <p>
*
* @param authenticationException 登录的authentication 对象
@@ -19,6 +19,7 @@ package com.pig4cloud.pigx.admin.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.RandomUtil;
import com.baomidou.mybatisplus.core.toolkit.StringPool;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.pig4cloud.pigx.admin.api.entity.SysUser;
import com.pig4cloud.pigx.admin.mapper.SysUserMapper;
@@ -67,7 +68,7 @@ public class MobileServiceImpl implements MobileService {
return R.ok(Boolean.FALSE, "手机号未注册");
}
Object codeObj = redisTemplate.opsForValue().get(CommonConstants.DEFAULT_CODE_KEY + LoginTypeEnum.SMS.getType() + "@" + mobile);
Object codeObj = redisTemplate.opsForValue().get(CommonConstants.DEFAULT_CODE_KEY + LoginTypeEnum.SMS.getType() + StringPool.AT + mobile);
if (codeObj != null) {
log.info("手机号验证码未过期:{},{}", mobile, codeObj);
@@ -77,7 +78,7 @@ public class MobileServiceImpl implements MobileService {
String code = RandomUtil.randomNumbers(Integer.parseInt(SecurityConstants.CODE_SIZE));
log.debug("手机号生成验证码成功:{},{}", mobile, code);
redisTemplate.opsForValue().set(
CommonConstants.DEFAULT_CODE_KEY + LoginTypeEnum.SMS.getType() + "@" + mobile
CommonConstants.DEFAULT_CODE_KEY + LoginTypeEnum.SMS.getType() + StringPool.AT + mobile
, code, SecurityConstants.CODE_TIME, TimeUnit.SECONDS);
return R.ok(Boolean.TRUE, code);
}