mirror of
https://gitee.com/dromara/sa-token.git
synced 2025-10-27 02:59:02 +08:00
优化版本检查器校验不通过时的提示语
This commit is contained in:
@@ -1,8 +1,15 @@
|
||||
package cn.dev33.satoken.reactor.spring;
|
||||
|
||||
import cn.dev33.satoken.exception.SaTokenException;
|
||||
import cn.dev33.satoken.util.SaFoxUtil;
|
||||
import org.springframework.boot.SpringBootVersion;
|
||||
|
||||
/**
|
||||
* SpringBoot 版本与 Sa-Token 版本兼容检查器
|
||||
*
|
||||
* @author Uncarbon
|
||||
* @since 1.38.0
|
||||
*/
|
||||
public class SpringBootVersionCompatibilityChecker {
|
||||
|
||||
public SpringBootVersionCompatibilityChecker() {
|
||||
@@ -10,6 +17,9 @@ public class SpringBootVersionCompatibilityChecker {
|
||||
if (SaFoxUtil.isEmpty(version) || version.startsWith("1.") || version.startsWith("2.")) {
|
||||
return;
|
||||
}
|
||||
throw new BootstrapMethodError("当前Spring-Boot版本为" + version + ",请尝试改用:sa-token-reactor-spring-boot3-starter");
|
||||
String str = "当前 SpringBoot 版本(" + version + ")与 Sa-Token 依赖不兼容," +
|
||||
"请将依赖 sa-token-reactor-spring-boot-starter 修改为:sa-token-reactor-spring-boot3-starter";
|
||||
System.err.println(str);
|
||||
throw new SaTokenException(str);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user