1.建立一个springboot-web项目 https://www.cnblogs.com/liuyangfirst/p/8298588.html 2.加入过滤接口 public class LoginInterceptor implements HandlerInterceptor { @Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object hand