| | |
| | | package com.ruoyi.framework.config; |
| | | |
| | | import cn.dev33.satoken.interceptor.SaAnnotationInterceptor; |
| | | import cn.dev33.satoken.interceptor.SaRouteInterceptor; |
| | | import cn.dev33.satoken.interceptor.SaInterceptor; |
| | | import cn.dev33.satoken.jwt.StpLogicJwtForSimple; |
| | | import cn.dev33.satoken.router.SaRouter; |
| | | import cn.dev33.satoken.stp.StpLogic; |
| | |
| | | @Override |
| | | public void addInterceptors(InterceptorRegistry registry) { |
| | | // 注册路由拦截器,自定义验证规则 |
| | | registry.addInterceptor(new SaRouteInterceptor((request, response, handler) -> { |
| | | registry.addInterceptor(new SaInterceptor(handler -> { |
| | | ExcludeUrlProperties excludeUrlProperties = SpringUtils.getBean(ExcludeUrlProperties.class); |
| | | // 登录验证 -- 排除多个路径 |
| | | SaRouter |
| | |
| | | |
| | | }); |
| | | })).addPathPatterns("/**"); |
| | | registry.addInterceptor(new SaAnnotationInterceptor()).addPathPatterns("/**"); |
| | | } |
| | | |
| | | @Bean |