From 16e47a8466b79daa49bb74aba06cf20020efcfa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=96=AF=E7=8B=82=E7=9A=84=E7=8B=AE=E5=AD=90Li?= <15040126243@163.com> Date: Tue, 25 Jul 2023 12:58:50 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E5=88=A0=E9=99=A4=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E8=B7=9Fswagger=E6=9C=89=E5=85=B3=E7=9A=84=E5=AD=97=E7=9C=BC?= =?UTF-8?q?=20=E9=81=BF=E5=85=8D=E8=AF=AF=E8=A7=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ruoyi-admin/src/main/resources/application.yml | 6 +++--- .../dromara/common/doc/config/SpringDocConfig.java | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index bd3d2dd0..616446d2 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -187,9 +187,9 @@ springdoc: api-docs: # 是否开启接口文档 enabled: true - swagger-ui: - # 持久化认证数据 - persistAuthorization: true +# swagger-ui: +# # 持久化认证数据 +# persistAuthorization: true info: # 标题 title: '标题:${ruoyi.name}多租户管理系统_接口文档' diff --git a/ruoyi-common/ruoyi-common-doc/src/main/java/org/dromara/common/doc/config/SpringDocConfig.java b/ruoyi-common/ruoyi-common-doc/src/main/java/org/dromara/common/doc/config/SpringDocConfig.java index 4e323800..069ef9ac 100644 --- a/ruoyi-common/ruoyi-common-doc/src/main/java/org/dromara/common/doc/config/SpringDocConfig.java +++ b/ruoyi-common/ruoyi-common-doc/src/main/java/org/dromara/common/doc/config/SpringDocConfig.java @@ -44,18 +44,18 @@ public class SpringDocConfig { @Bean @ConditionalOnMissingBean(OpenAPI.class) - public OpenAPI openApi(SpringDocProperties swaggerProperties) { + public OpenAPI openApi(SpringDocProperties properties) { OpenAPI openApi = new OpenAPI(); // 文档基本信息 - SpringDocProperties.InfoProperties infoProperties = swaggerProperties.getInfo(); + SpringDocProperties.InfoProperties infoProperties = properties.getInfo(); Info info = convertInfo(infoProperties); openApi.info(info); // 扩展文档信息 - openApi.externalDocs(swaggerProperties.getExternalDocs()); - openApi.tags(swaggerProperties.getTags()); - openApi.paths(swaggerProperties.getPaths()); - openApi.components(swaggerProperties.getComponents()); - Set keySet = swaggerProperties.getComponents().getSecuritySchemes().keySet(); + openApi.externalDocs(properties.getExternalDocs()); + openApi.tags(properties.getTags()); + openApi.paths(properties.getPaths()); + openApi.components(properties.getComponents()); + Set keySet = properties.getComponents().getSecuritySchemes().keySet(); List list = new ArrayList<>(); SecurityRequirement securityRequirement = new SecurityRequirement(); keySet.forEach(securityRequirement::addList);