web存储
使用web存储,数据可以保存在客户端,以键值对存在,只允许该网页访问使用。分为localStorage和sessionStorage两种
localStorage
用于长久保存整个网站的数据,保存的数据没有过期时间,直到手动去除
1 | // 保存数据 |
使用web存储,数据可以保存在客户端,以键值对存在,只允许该网页访问使用。分为localStorage和sessionStorage两种
用于长久保存整个网站的数据,保存的数据没有过期时间,直到手动去除
1 | // 保存数据 |
登录请求进入UsernamePasswordAuthenticationFilter,父类是AbstractAuthenticationProcessingFilter,执行AbstractAuthenticationProcessingFilter的doFilter方法
1 | authResult = attemptAuthentication(request, response); |
确认该请求是否需要认证,如果需要认证且此时还没有进行认证,则尝试进行认证,调用UsernamePasswordAuthenticationFilter的attemptAuthentication方法,将从请求中获取的用户名和密码封装成UsernamePasswordAuthenticationToken对象(认证状态为未认证)
1 | UsernamePasswordAuthenticationToken authRequest = new UsernamePasswordAuthenticationToken( |
通过AuthenticationManager(实现类是ProviderManager)委托AuthenticationProvider(实现类是DaoAuthenticationProvider)关联UserDetailsService进行认证过程