标题的localhost重定向次数过多
无论是清理缓存、删除目标还是使用调试断点,您都进入了拦截器,最后发现您在拦截器中拦截了登录界面。 一开始我没有写login和index。 访问资源时,拦截器会拦截到登录接口。 登录接口也是拦截器截获的资源,会导致死循环。 不需要像登录界面那样通过拦截器进行监听。
@ overridepublicvoidaddinterceptors (interceptorregistryregistry ) /需要实现拦截器功能的实例对象。 在此设定需要侦听的资源(nologininterceptorregistry.add interceptor (nolog in interceptor ) ) /。 addpath patterns (/* * ' ) ) /默认侦听所有内容无需被侦听的资源. excludepathpatterns((/CSS/** )、)/images/* )