疯狂的狮子li
2021-10-21 6ab575cd49944863419fe884b3771d9ded558c15
update 优化处理过期方法 采用新写法
已修改1个文件
8 ■■■■ 文件已修改
ruoyi-framework/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-framework/src/main/java/com/ruoyi/framework/config/ResourcesConfig.java
@@ -37,12 +37,12 @@
        // 注册路由拦截器,自定义验证规则
        registry.addInterceptor(new SaRouteInterceptor((request, response, handler) -> {
            // 登录验证 -- 排除多个路径
            SaRouter.match(
            SaRouter
                    //获取所有的
                    Collections.singletonList("/**"),
                    .match(Collections.singletonList("/**"))
                    //排除下不需要拦截的
                    Arrays.asList(securityProperties.getExcludes()),
                    () -> {
                    .notMatch(Arrays.asList(securityProperties.getExcludes()))
                    .check(() -> {
                        Long userId = SecurityUtils.getUserId();
                        if(StringUtils.isNotNull(userId) ) {
                            long tokenTimeout = StpUtil.getTokenTimeout();