提交 f3d72ae9 作者: 方治民

chore: upgrade deps(SpringBoot v3.4.5)

上级 b06b5afb
...@@ -2,14 +2,14 @@ plugins { ...@@ -2,14 +2,14 @@ plugins {
id 'java' id 'java'
id 'java-library' id 'java-library'
// https://start.spring.io // https://start.spring.io
id 'org.springframework.boot' version '3.4.3' id 'org.springframework.boot' version '3.4.5'
id 'org.graalvm.buildtools.native' version '0.10.5' id 'org.graalvm.buildtools.native' version '0.10.6'
// https://plugins.gradle.org/plugin/io.spring.dependency-management // https://plugins.gradle.org/plugin/io.spring.dependency-management
id 'io.spring.dependency-management' version '1.1.7' id 'io.spring.dependency-management' version '1.1.7'
// https://plugins.gradle.org/plugin/com.diffplug.spotless // https://plugins.gradle.org/plugin/com.diffplug.spotless
id "com.diffplug.spotless" version "7.0.2" id "com.diffplug.spotless" version "7.0.3"
// https://plugins.gradle.org/plugin/com.gorylenko.gradle-git-properties // https://plugins.gradle.org/plugin/com.gorylenko.gradle-git-properties
id "com.gorylenko.gradle-git-properties" version "2.4.2" id "com.gorylenko.gradle-git-properties" version "2.5.0"
} }
ext { ext {
...@@ -25,35 +25,35 @@ ext { ...@@ -25,35 +25,35 @@ ext {
// SpringCloud // SpringCloud
// https://start.spring.io/ // https://start.spring.io/
springCloudVersion = '2024.0.0' springCloudVersion = '2024.0.1'
// SpringBootAdmin // SpringBootAdmin
// https://central.sonatype.com/artifact/de.codecentric/spring-boot-admin-starter-server // https://central.sonatype.com/artifact/de.codecentric/spring-boot-admin-starter-server
springBootAdminVersion = '3.4.3' springBootAdminVersion = '3.4.5'
// Sentry // Sentry
// https://central.sonatype.com/artifact/io.sentry/sentry-spring-boot-starter-jakarta // https://central.sonatype.com/artifact/io.sentry/sentry-spring-boot-starter-jakarta
sentryVersion = '8.2.0' sentryVersion = '8.12.0'
// Dependencies // Dependencies
// https://central.sonatype.com/artifact/com.github.xiaoymin/knife4j-openapi3-jakarta-spring-boot-starter // https://central.sonatype.com/artifact/com.github.xiaoymin/knife4j-openapi3-jakarta-spring-boot-starter
knife4jOpen3Version = '4.5.0' knife4jOpen3Version = '4.5.0'
// https://central.sonatype.com/artifact/io.swagger.core.v3/swagger-annotations // https://central.sonatype.com/artifact/io.swagger.core.v3/swagger-annotations
swaggerAnnotationsVersion = '2.2.28' swaggerAnnotationsVersion = '2.2.32'
// https://central.sonatype.com/artifact/cn.dev33/sa-token-spring-boot3-starter // https://central.sonatype.com/artifact/cn.dev33/sa-token-spring-boot3-starter
saTokenVersion = '1.40.0' saTokenVersion = '1.43.0'
// https://central.sonatype.com/artifact/cn.hutool/hutool-core // https://central.sonatype.com/artifact/cn.hutool/hutool-core
hutoolVersion = '5.8.36' hutoolVersion = '5.8.38'
// https://central.sonatype.com/artifact/com.alibaba.fastjson2/fastjson2 // https://central.sonatype.com/artifact/com.alibaba.fastjson2/fastjson2
fastJsonVersion = '2.0.56' fastJsonVersion = '2.0.57'
// https://central.sonatype.com/artifact/com.xuxueli/xxl-job-core // https://central.sonatype.com/artifact/com.xuxueli/xxl-job-core
xxlJobVersion = '3.0.0' xxlJobVersion = '3.1.0'
// https://central.sonatype.com/artifact/io.minio/minio // https://central.sonatype.com/artifact/io.minio/minio
minioVersion = '8.5.17' minioVersion = '8.5.17'
// https://central.sonatype.com/artifact/io.hypersistence/hypersistence-utils-hibernate-63 // https://central.sonatype.com/artifact/io.hypersistence/hypersistence-utils-hibernate-63
hibernateTypesVersion = '3.9.2' hibernateTypesVersion = '3.9.10'
// https://central.sonatype.com/artifact/org.hibernate.orm/hibernate-spatial // https://central.sonatype.com/artifact/org.hibernate.orm/hibernate-spatial
hibernateSpatialVersion = '6.6.9.Final' hibernateSpatialVersion = '6.6.15.Final'
// https://central.sonatype.com/artifact/org.locationtech.jts/jts-core // https://central.sonatype.com/artifact/org.locationtech.jts/jts-core
jtsVersion = '1.20.0' jtsVersion = '1.20.0'
// https://mvnrepository.com/artifact/org.n52.jackson/jackson-datatype-jts // https://mvnrepository.com/artifact/org.n52.jackson/jackson-datatype-jts
...@@ -63,7 +63,7 @@ ext { ...@@ -63,7 +63,7 @@ ext {
// https://central.sonatype.com/artifact/org.jetbrains/annotations // https://central.sonatype.com/artifact/org.jetbrains/annotations
jetbrainsAnnotationsVersion = '26.0.2' jetbrainsAnnotationsVersion = '26.0.2'
// https://central.sonatype.com/artifact/org.apache.pdfbox/pdfbox // https://central.sonatype.com/artifact/org.apache.pdfbox/pdfbox
pdfboxVersion = '3.0.4' pdfboxVersion = '3.0.5'
// https://central.sonatype.com/artifact/org.lionsoul/ip2region // https://central.sonatype.com/artifact/org.lionsoul/ip2region
ip2regionVersion = '2.7.0' ip2regionVersion = '2.7.0'
// https://central.sonatype.com/artifact/com.github.piomin/loki-logging-spring-boot-starter // https://central.sonatype.com/artifact/com.github.piomin/loki-logging-spring-boot-starter
...@@ -139,6 +139,7 @@ subprojects { ...@@ -139,6 +139,7 @@ subprojects {
// skip Test tasks // skip Test tasks
gradle.taskGraph.whenReady { gradle.taskGraph.whenReady {
gitProperties.dotGitDirectory = project.rootProject.layout.projectDirectory.dir('.git')
tasks.each { task -> tasks.each { task ->
if (task.name.contains("test")) { if (task.name.contains("test")) {
task.enabled = false task.enabled = false
......
...@@ -4,8 +4,11 @@ package com.yiring.auth.config; ...@@ -4,8 +4,11 @@ package com.yiring.auth.config;
import cn.dev33.satoken.interceptor.SaInterceptor; import cn.dev33.satoken.interceptor.SaInterceptor;
import cn.dev33.satoken.router.SaHttpMethod; import cn.dev33.satoken.router.SaHttpMethod;
import cn.dev33.satoken.router.SaRouter; import cn.dev33.satoken.router.SaRouter;
import cn.dev33.satoken.spring.pathmatch.SaPatternsRequestConditionHolder;
import cn.dev33.satoken.stp.StpUtil; import cn.dev33.satoken.stp.StpUtil;
import cn.dev33.satoken.strategy.SaStrategy;
import com.yiring.auth.util.Auths; import com.yiring.auth.util.Auths;
import jakarta.annotation.PostConstruct;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
...@@ -21,6 +24,14 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; ...@@ -21,6 +24,14 @@ import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration @Configuration
public class SaTokenConfigure implements WebMvcConfigurer { public class SaTokenConfigure implements WebMvcConfigurer {
/**
* 重写路由匹配算法,切换为 ant_path_matcher 模式,使之可以支持 `**` 之后再出现内容
*/
@PostConstruct
public void customRouteMatcher() {
SaStrategy.instance.routeMatcher = SaPatternsRequestConditionHolder::match;
}
@Override @Override
public void addInterceptors(InterceptorRegistry registry) { public void addInterceptors(InterceptorRegistry registry) {
// 注册 Sa-Token 路由拦截器 // 注册 Sa-Token 路由拦截器
......
/* (C) 2023 YiRing, Inc. */
package com.yiring.auth.config;
import cn.dev33.satoken.spring.SaTokenContextForSpringInJakartaServlet;
import cn.dev33.satoken.spring.pathmatch.SaPatternsRequestConditionHolder;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;
/**
* 自定义 SaTokenContext 实现类,重写 matchPath 方法,切换为 ant_path_matcher 模式,使之可以支持 `**` 之后再出现内容
* @author Jim
* @version 0.1
* 2023/12/19 11:57
*/
@Primary
@Component
public class SaTokenContextByPatternsRequestCondition extends SaTokenContextForSpringInJakartaServlet {
@Override
public boolean matchPath(String pattern, String path) {
return SaPatternsRequestConditionHolder.match(pattern, path);
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论