diff --git a/pom.xml b/pom.xml
index 6c2b99e6..94ab8d5c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -21,7 +21,6 @@
3.1.1
1.2.6
3.0.2
- 1.5.22
1.2.76
4.1.2
1.7
@@ -58,18 +57,6 @@
com.github.xiaoymin
knife4j-spring-boot-starter
${knife4j.version}
-
-
- swagger-annotations
- io.swagger
-
-
-
-
-
- io.swagger
- swagger-annotations
- ${swagger-annotations.version}
diff --git a/ruoyi-common/pom.xml b/ruoyi-common/pom.xml
index 2c75fcd1..c6275c25 100644
--- a/ruoyi-common/pom.xml
+++ b/ruoyi-common/pom.xml
@@ -136,11 +136,6 @@
knife4j-spring-boot-starter
-
- io.swagger
- swagger-annotations
-
-
org.springframework.boot
spring-boot-starter-actuator
diff --git a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SwaggerConfig.java b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SwaggerConfig.java
index 1a92ca08..7b5d9510 100644
--- a/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SwaggerConfig.java
+++ b/ruoyi-framework/src/main/java/com/ruoyi/framework/config/SwaggerConfig.java
@@ -3,6 +3,7 @@ package com.ruoyi.framework.config;
import com.github.xiaoymin.knife4j.spring.annotations.EnableKnife4j;
import com.ruoyi.framework.config.properties.SwaggerProperties;
import io.swagger.annotations.ApiOperation;
+import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@@ -13,7 +14,6 @@ import springfox.documentation.service.*;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spi.service.contexts.SecurityContext;
import springfox.documentation.spring.web.plugins.Docket;
-import springfox.documentation.swagger2.annotations.EnableSwagger2;
import java.util.ArrayList;
import java.util.List;
@@ -24,7 +24,6 @@ import java.util.List;
* @author Lion Li
*/
@Configuration
-@EnableSwagger2
@EnableKnife4j
public class SwaggerConfig {
@@ -36,7 +35,7 @@ public class SwaggerConfig {
*/
@Bean
public Docket createRestApi() {
- return new Docket(DocumentationType.SWAGGER_2)
+ return new Docket(DocumentationType.OAS_30)
.enable(swaggerProperties.getEnabled())
// 用来创建该API的基本信息,展示在文档的页面中(自定义展示的信息)
.apiInfo(apiInfo())
@@ -60,7 +59,7 @@ public class SwaggerConfig {
*/
private List securitySchemes() {
List apiKeyList = new ArrayList();
- apiKeyList.add(new ApiKey("Authorization", "Authorization", "header"));
+ apiKeyList.add(new ApiKey("Authorization", "Authorization", In.HEADER.toValue()));
return apiKeyList;
}
@@ -72,7 +71,7 @@ public class SwaggerConfig {
securityContexts.add(
SecurityContext.builder()
.securityReferences(defaultAuth())
- .forPaths(PathSelectors.regex("^(?!auth).*$"))
+ .operationSelector(o -> o.requestMappingPattern().matches("/.*"))
.build());
return securityContexts;
}