wuyouzhuguli / SpringAll

循序渐进,学习Spring Boot、Spring Boot & Shiro、Spring Batch、Spring Cloud、Spring Cloud Alibaba、Spring Security & Spring Security OAuth2,博客Spring系列源码:https://mrbird.cc
MIT License
28.21k stars 8.11k forks source link

security 短信验证码登录,验证码不存在 #24

Closed fengjunzixian closed 4 years ago

fengjunzixian commented 4 years ago

获取到了验证码后登陆,在校验验证码过滤器时候

fengjunzixian commented 4 years ago

SmsCode codeInSession = (SmsCode) sessionStrategy.getAttribute(servletWebRequest, ValidateController.SESSION_KEY_SMS_CODE + mobileInRequest);
sessionStrategy 获取不到之前设置的 缓存id

wuyouzhuguli commented 4 years ago

是不是存储的key和获取的key不一致?文章源码我是跑过后才上传的,可以参考下。

fengjunzixian commented 4 years ago

不好意思, 手机号写死了,生成校验码的是177777777, 登录请求的是实际填写的手机号,两者不一致....