优化 Swagger 的版本依赖,避免冲突

This commit is contained in:
YunaiV
2023-03-04 15:05:58 +08:00
parent e28d73a76c
commit 59c6963f7c
17 changed files with 135 additions and 77 deletions

View File

@@ -1,28 +0,0 @@
package cn.iocoder.yudao.module.bpm.framework.bpm.config;
import cn.iocoder.yudao.framework.security.config.AuthorizeRequestsCustomizer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configurers.ExpressionUrlAuthorizationConfigurer;
/**
* @author kemengkai
* @create 2022-05-07 08:15
*/
@Configuration(proxyBeanMethods = false, value = "bpmSecurityConfiguration")
public class BpmSecurityConfiguration {
@Bean("bpmAuthorizeRequestsCustomizer")
public AuthorizeRequestsCustomizer authorizeRequestsCustomizer() {
return new AuthorizeRequestsCustomizer() {
@Override
public void customize(ExpressionUrlAuthorizationConfigurer<HttpSecurity>.ExpressionInterceptUrlRegistry registry) {
// 任务回退接口
registry.antMatchers(buildAdminApi("/bpm/task/back")).permitAll();
}
};
}
}

View File

@@ -21,10 +21,8 @@ public class SecurityConfiguration {
public void customize(ExpressionUrlAuthorizationConfigurer<HttpSecurity>.ExpressionInterceptUrlRegistry registry) {
// TODO 芋艿:这个每个项目都需要重复配置,得捉摸有没通用的方案
// Swagger 接口文档
registry.antMatchers("/swagger-ui.html").anonymous()
.antMatchers("/swagger-resources/**").anonymous()
.antMatchers("/webjars/**").anonymous()
.antMatchers("/*/api-docs").anonymous();
registry.antMatchers("/v3/api-docs/**").permitAll() // 元数据
.antMatchers("/swagger-ui.html").permitAll(); // Swagger UI
// Druid 监控
registry.antMatchers("/druid/**").anonymous();
// Spring Boot Actuator 的安全配置

View File

@@ -27,6 +27,21 @@ spring:
redis:
time-to-live: 1h # 设置过期时间为 1 小时
--- #################### 接口文档配置 ####################
springdoc:
api-docs:
enabled: true # 1. 是否开启 Swagger 接文档的元数据
path: /v3/api-docs
swagger-ui:
enabled: true # 2.1 是否开启 Swagger 文档的官方 UI 界面
path: /swagger-ui.html
knife4j:
enable: true # 2.2 是否开启 Swagger 文档的 Knife4j UI 界面
setting:
language: zh_cn
# 工作流 Flowable 配置
flowable:
# 1. false: 默认值Flowable 启动时,对比数据库表中保存的版本,如果不匹配。将抛出异常