From cba69e94df970ed5e6290a9d0578603ec5fd049b Mon Sep 17 00:00:00 2001 From: xingyu Date: Mon, 16 Jan 2023 15:15:31 +0800 Subject: [PATCH] revert: file --- yudao-dependencies/pom.xml | 13 ------------- .../yudao-spring-boot-starter-web/pom.xml | 10 ---------- .../config/YudaoSwaggerAutoConfiguration.java | 14 +++++--------- .../admin/captcha/CaptchaController.java | 10 +++++----- yudao-server/src/main/resources/application.yaml | 7 +++++++ yudao-ui-admin-vue3/.env.dev | 4 ++-- yudao-ui-admin-vue3/.env.pro | 4 ++-- yudao-ui-admin-vue3/.env.test | 4 ++-- 8 files changed, 23 insertions(+), 43 deletions(-) diff --git a/yudao-dependencies/pom.xml b/yudao-dependencies/pom.xml index d1038eb5b..af759726f 100644 --- a/yudao-dependencies/pom.xml +++ b/yudao-dependencies/pom.xml @@ -18,7 +18,6 @@ 2.7.7 - 1.6.14 4.0.0 2.5 @@ -170,18 +169,6 @@ ${knife4j.version} - - org.springdoc - springdoc-openapi-ui - ${springdoc.version} - - - - org.springdoc - springdoc-openapi-security - ${springdoc.version} - - cn.iocoder.boot diff --git a/yudao-framework/yudao-spring-boot-starter-web/pom.xml b/yudao-framework/yudao-spring-boot-starter-web/pom.xml index 5a4951ae9..89d35f44f 100644 --- a/yudao-framework/yudao-spring-boot-starter-web/pom.xml +++ b/yudao-framework/yudao-spring-boot-starter-web/pom.xml @@ -38,16 +38,6 @@ knife4j-openapi3-spring-boot-starter - - org.springdoc - springdoc-openapi-ui - - - - org.springdoc - springdoc-openapi-security - - org.springframework.security spring-security-core diff --git a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/swagger/config/YudaoSwaggerAutoConfiguration.java b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/swagger/config/YudaoSwaggerAutoConfiguration.java index 9e05fe3a0..a064ee46d 100644 --- a/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/swagger/config/YudaoSwaggerAutoConfiguration.java +++ b/yudao-framework/yudao-spring-boot-starter-web/src/main/java/cn/iocoder/yudao/framework/swagger/config/YudaoSwaggerAutoConfiguration.java @@ -4,8 +4,8 @@ import io.swagger.v3.oas.models.Components; import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.info.Info; import io.swagger.v3.oas.models.info.License; -import io.swagger.v3.oas.models.security.SecurityRequirement; import io.swagger.v3.oas.models.security.SecurityScheme; +import org.springdoc.core.GroupedOpenApi; import org.springdoc.core.*; import org.springdoc.core.customizers.OpenApiBuilderCustomizer; import org.springdoc.core.customizers.ServerBaseUrlCustomizer; @@ -44,21 +44,16 @@ public class YudaoSwaggerAutoConfiguration { //鉴权组件(随便起名的) SecurityScheme securityScheme = new SecurityScheme() .type(SecurityScheme.Type.APIKEY) - .scheme("bearer")//固定写法 + .scheme("Bearer")//固定写法 .bearerFormat("JWT") .in(SecurityScheme.In.HEADER) .name(HttpHeaders.AUTHORIZATION); Components components = new Components() - .addSecuritySchemes("Bearer", securityScheme); - - //鉴权限制要求(随便起名的) - SecurityRequirement securityRequirement = new SecurityRequirement() - .addList(HttpHeaders.AUTHORIZATION, Arrays.asList("read", "write")); + .addSecuritySchemes("bearer", securityScheme); return new OpenAPI() .info(info) - .components(components) - .addSecurityItem(securityRequirement); + .components(components); } /** @@ -92,3 +87,4 @@ public class YudaoSwaggerAutoConfiguration { } } + diff --git a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/captcha/CaptchaController.java b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/captcha/CaptchaController.java index 71a02efd4..92359fda9 100644 --- a/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/captcha/CaptchaController.java +++ b/yudao-module-system/yudao-module-system-biz/src/main/java/cn/iocoder/yudao/module/system/controller/admin/captcha/CaptchaController.java @@ -6,8 +6,8 @@ import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; import com.anji.captcha.model.common.ResponseModel; import com.anji.captcha.model.vo.CaptchaVO; import com.anji.captcha.service.CaptchaService; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestMapping; @@ -22,7 +22,7 @@ import javax.servlet.http.HttpServletRequest; * * @author 芋道源码 */ -@Api(tags = "管理后台 - 验证码") +@Tag(name = "管理后台 - 验证码") @RestController("adminCaptchaController") @RequestMapping("/system/captcha") public class CaptchaController { @@ -31,7 +31,7 @@ public class CaptchaController { private CaptchaService captchaService; @PostMapping({"/get"}) - @ApiOperation("获得验证码") + @Operation(summary = "获得验证码") @PermitAll @OperateLog(enable = false) // 避免 Post 请求被记录操作日志 public ResponseModel get(@RequestBody CaptchaVO data, HttpServletRequest request) { @@ -41,7 +41,7 @@ public class CaptchaController { } @PostMapping("/check") - @ApiOperation("校验验证码") + @Operation(summary = "校验验证码") @PermitAll @OperateLog(enable = false) // 避免 Post 请求被记录操作日志 public ResponseModel check(@RequestBody CaptchaVO data, HttpServletRequest request) { diff --git a/yudao-server/src/main/resources/application.yaml b/yudao-server/src/main/resources/application.yaml index 3ba88daa1..0cc0d271e 100644 --- a/yudao-server/src/main/resources/application.yaml +++ b/yudao-server/src/main/resources/application.yaml @@ -38,6 +38,13 @@ springdoc: show-actuator: true swagger-ui: path: /swagger-ui + api-docs: + path: /v3/api-docs + +knife4j: + enable: true + setting: + language: zh_cn # 工作流 Flowable 配置 flowable: diff --git a/yudao-ui-admin-vue3/.env.dev b/yudao-ui-admin-vue3/.env.dev index a67cdc686..bece32fd3 100644 --- a/yudao-ui-admin-vue3/.env.dev +++ b/yudao-ui-admin-vue3/.env.dev @@ -2,10 +2,10 @@ NODE_ENV=production # 请求路径 -VITE_BASE_URL='http://localhost:48080' +VITE_BASE_URL='http://localhost:58080' # 上传路径 -VITE_UPLOAD_URL='http://localhost:48080/admin-api/infra/file/upload' +VITE_UPLOAD_URL='http://localhost:58080/admin-api/infra/file/upload' # 接口前缀 VITE_API_BASEPATH=/dev-api diff --git a/yudao-ui-admin-vue3/.env.pro b/yudao-ui-admin-vue3/.env.pro index 4b47737e1..36168fe0e 100644 --- a/yudao-ui-admin-vue3/.env.pro +++ b/yudao-ui-admin-vue3/.env.pro @@ -2,10 +2,10 @@ NODE_ENV=production # 请求路径 -VITE_BASE_URL='http://localhost:48080' +VITE_BASE_URL='http://localhost:58080' # 上传路径 -VITE_UPLOAD_URL='http://localhost:48080/admin-api/infra/file/upload' +VITE_UPLOAD_URL='http://localhost:58080/admin-api/infra/file/upload' # 接口前缀 VITE_API_BASEPATH= diff --git a/yudao-ui-admin-vue3/.env.test b/yudao-ui-admin-vue3/.env.test index 6166840fa..e1a0c33b9 100644 --- a/yudao-ui-admin-vue3/.env.test +++ b/yudao-ui-admin-vue3/.env.test @@ -2,10 +2,10 @@ NODE_ENV=production # 请求路径 -VITE_BASE_URL='http://localhost:48080' +VITE_BASE_URL='http://localhost:58080' # 上传路径 -VITE_UPLOAD_URL='http://localhost:48080/admin-api/infra/file/upload' +VITE_UPLOAD_URL='http://localhost:58080/admin-api/infra/file/upload' # 接口前缀 VITE_API_BASEPATH=