修复路由拦截鉴权可被绕过的问题 fix #515

This commit is contained in:
click33
2023-10-16 16:02:19 +08:00
parent f2416a6175
commit 954efeb732
33 changed files with 688 additions and 79 deletions

View File

@@ -11,6 +11,7 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.5.14</version>
<!--<version>2.3.0.RELEASE</version>-->
<!-- <version>1.5.9.RELEASE</version> -->
<relativePath/>
</parent>

View File

@@ -23,5 +23,5 @@ public class NotFoundHandle implements ErrorController {
response.setStatus(200);
return SaResult.get(404, "not found", null);
}
}

View File

@@ -1,5 +1,7 @@
package com.pj.test;
import cn.dev33.satoken.context.SaHolder;
import cn.dev33.satoken.spring.SpringMVCUtil;
import cn.dev33.satoken.stp.SaLoginConfig;
import cn.dev33.satoken.stp.StpUtil;
import cn.dev33.satoken.util.SaFoxUtil;
@@ -41,4 +43,13 @@ public class TestController {
return SaResult.ok();
}
// 测试 浏览器访问: http://localhost:8081/test/getRequestPath
@RequestMapping("getRequestPath")
public SaResult getRequestPath() {
System.out.println("------------ 测试访问路径获取 ");
System.out.println("SpringMVCUtil.getRequest().getRequestURI() " + SpringMVCUtil.getRequest().getRequestURI());
System.out.println("SaHolder.getRequest().getRequestPath() " + SaHolder.getRequest().getRequestPath());
return SaResult.ok();
}
}

View File

@@ -19,7 +19,7 @@ sa-token:
# 是否输出操作日志
is-log: true
spring:
spring:
# redis配置
redis:
# Redis数据库索引默认为0