1.登录增强 2.用户表增加身份证字段 3.钉钉跳转修复
This commit is contained in:
1 parent
fff9b6e40f
commit
93b288ed9d
21 files changed
+256
-66
No files matched your search
+15
-4
@@ -131,29 +131,40 @@ public class ValidateCodeFilter extends OncePerRequestFilter {
|
||||
|
||||
String key = CacheConstants.DEFAULT_CODE_KEY + randomStr;
|
||||
if (Boolean.FALSE.equals(redisTemplate.hasKey(key))) {
|
||||
throw new ValidateCodeException(MsgUtils.getMessage(ErrorCodes.AUTH_CAPTCHA_INVALID));
|
||||
throw new ValidateCodeException(invalidCodeMessage(mobile));
|
||||
}
|
||||
|
||||
Object codeObj = redisTemplate.opsForValue().get(key);
|
||||
|
||||
if (codeObj == null) {
|
||||
throw new ValidateCodeException(MsgUtils.getMessage(ErrorCodes.AUTH_CAPTCHA_INVALID));
|
||||
throw new ValidateCodeException(invalidCodeMessage(mobile));
|
||||
}
|
||||
|
||||
String saveCode = codeObj.toString();
|
||||
if (StrUtil.isBlank(saveCode)) {
|
||||
redisTemplate.delete(key);
|
||||
throw new ValidateCodeException(MsgUtils.getMessage(ErrorCodes.AUTH_CAPTCHA_INVALID));
|
||||
throw new ValidateCodeException(invalidCodeMessage(mobile));
|
||||
}
|
||||
|
||||
if (!StrUtil.equals(saveCode, code)) {
|
||||
redisTemplate.delete(key);
|
||||
throw new ValidateCodeException(MsgUtils.getMessage(ErrorCodes.AUTH_CAPTCHA_INVALID));
|
||||
throw new ValidateCodeException(invalidCodeMessage(mobile));
|
||||
}
|
||||
|
||||
redisTemplate.delete(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* 短信登录与图形验证码使用不同提示:已使用/过期的短信码对用户更友好。
|
||||
*/
|
||||
private String invalidCodeMessage(String mobile) {
|
||||
// mobile 参数形如 SMS@138xxxx
|
||||
if (StrUtil.isNotBlank(mobile) && StrUtil.contains(mobile, "SMS")) {
|
||||
return MsgUtils.getMessage(ErrorCodes.SYS_APP_SMS_CODE_INVALID);
|
||||
}
|
||||
return MsgUtils.getMessage(ErrorCodes.AUTH_CAPTCHA_INVALID);
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否需要校验客户端,根据client 查询客户端配置
|
||||
*
|
||||
|
||||
Reference in new issue
Block a user