Security 未登录时返回Json 而非跳转登录页面
jie最近使用vue做前后端分离的项目,每次重启服务或者session失效之后,导致Security 302 到登录页面,而且前端无法获取到302的状态,没法拦截后自己跳转,所以需要我们返回Json; 首先我们需要实现AuthenticationEntryPoint接口,重写它的commence方法,/** * @Description: * @author: lulu * @date: 2021/7/2 4:44 下午 */public class CustomAuthenti...
原创
2021-07-02 17:34:30 ·
1518 阅读 ·
4 评论