!289 feat: Spring Boot3.x错误地使用sa-token-*spring-boot-starter时,将阻断程序启动

Merge pull request !289 from Uncarbon/dev
This commit is contained in:
刘潇 2024-03-30 20:18:53 +00:00 committed by Gitee
commit 3ce3160f05
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
4 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,15 @@
package cn.dev33.satoken.reactor.spring;
import cn.dev33.satoken.util.SaFoxUtil;
import org.springframework.boot.SpringBootVersion;
public class SpringBootVersionCompatibilityChecker {
public SpringBootVersionCompatibilityChecker() {
String version = SpringBootVersion.getVersion();
if (SaFoxUtil.isEmpty(version) || version.startsWith("1.") || version.startsWith("2.")) {
return;
}
throw new BootstrapMethodError("当前Spring-Boot版本为" + version + "请尝试改用sa-token-reactor-spring-boot3-starter");
}
}

View File

@ -0,0 +1 @@
cn.dev33.satoken.reactor.spring.SpringBootVersionCompatibilityChecker

View File

@ -0,0 +1,15 @@
package cn.dev33.satoken.spring;
import cn.dev33.satoken.util.SaFoxUtil;
import org.springframework.boot.SpringBootVersion;
public class SpringBootVersionCompatibilityChecker {
public SpringBootVersionCompatibilityChecker() {
String version = SpringBootVersion.getVersion();
if (SaFoxUtil.isEmpty(version) || version.startsWith("1.") || version.startsWith("2.")) {
return;
}
throw new BootstrapMethodError("当前Spring-Boot版本为" + version + "请尝试改用sa-token-spring-boot3-starter");
}
}

View File

@ -0,0 +1 @@
cn.dev33.satoken.spring.SpringBootVersionCompatibilityChecker