Commit cba69e94df970ed5e6290a9d0578603ec5fd049b
1 parent
1c0d8fc1
revert: file
Showing
8 changed files
with
23 additions
and
43 deletions
yudao-dependencies/pom.xml
| @@ -18,7 +18,6 @@ | @@ -18,7 +18,6 @@ | ||
| 18 | <!-- 统一依赖管理 --> | 18 | <!-- 统一依赖管理 --> |
| 19 | <spring.boot.version>2.7.7</spring.boot.version> | 19 | <spring.boot.version>2.7.7</spring.boot.version> |
| 20 | <!-- Web 相关 --> | 20 | <!-- Web 相关 --> |
| 21 | - <springdoc.version>1.6.14</springdoc.version> | ||
| 22 | <knife4j.version>4.0.0</knife4j.version> | 21 | <knife4j.version>4.0.0</knife4j.version> |
| 23 | <servlet.versoin>2.5</servlet.versoin> | 22 | <servlet.versoin>2.5</servlet.versoin> |
| 24 | <!-- DB 相关 --> | 23 | <!-- DB 相关 --> |
| @@ -170,18 +169,6 @@ | @@ -170,18 +169,6 @@ | ||
| 170 | <version>${knife4j.version}</version> | 169 | <version>${knife4j.version}</version> |
| 171 | </dependency> | 170 | </dependency> |
| 172 | 171 | ||
| 173 | - <dependency> | ||
| 174 | - <groupId>org.springdoc</groupId> | ||
| 175 | - <artifactId>springdoc-openapi-ui</artifactId> | ||
| 176 | - <version>${springdoc.version}</version> | ||
| 177 | - </dependency> | ||
| 178 | - | ||
| 179 | - <dependency> | ||
| 180 | - <groupId>org.springdoc</groupId> | ||
| 181 | - <artifactId>springdoc-openapi-security</artifactId> | ||
| 182 | - <version>${springdoc.version}</version> | ||
| 183 | - </dependency> | ||
| 184 | - | ||
| 185 | <!-- DB 相关 --> | 172 | <!-- DB 相关 --> |
| 186 | <dependency> | 173 | <dependency> |
| 187 | <groupId>cn.iocoder.boot</groupId> | 174 | <groupId>cn.iocoder.boot</groupId> |
yudao-framework/yudao-spring-boot-starter-web/pom.xml
| @@ -39,16 +39,6 @@ | @@ -39,16 +39,6 @@ | ||
| 39 | </dependency> | 39 | </dependency> |
| 40 | 40 | ||
| 41 | <dependency> | 41 | <dependency> |
| 42 | - <groupId>org.springdoc</groupId> | ||
| 43 | - <artifactId>springdoc-openapi-ui</artifactId> | ||
| 44 | - </dependency> | ||
| 45 | - | ||
| 46 | - <dependency> | ||
| 47 | - <groupId>org.springdoc</groupId> | ||
| 48 | - <artifactId>springdoc-openapi-security</artifactId> | ||
| 49 | - </dependency> | ||
| 50 | - | ||
| 51 | - <dependency> | ||
| 52 | <groupId>org.springframework.security</groupId> | 42 | <groupId>org.springframework.security</groupId> |
| 53 | <artifactId>spring-security-core</artifactId> | 43 | <artifactId>spring-security-core</artifactId> |
| 54 | <scope>provided</scope> <!-- 设置为 provided,主要是 GlobalExceptionHandler 使用 --> | 44 | <scope>provided</scope> <!-- 设置为 provided,主要是 GlobalExceptionHandler 使用 --> |
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; | @@ -4,8 +4,8 @@ import io.swagger.v3.oas.models.Components; | ||
| 4 | import io.swagger.v3.oas.models.OpenAPI; | 4 | import io.swagger.v3.oas.models.OpenAPI; |
| 5 | import io.swagger.v3.oas.models.info.Info; | 5 | import io.swagger.v3.oas.models.info.Info; |
| 6 | import io.swagger.v3.oas.models.info.License; | 6 | import io.swagger.v3.oas.models.info.License; |
| 7 | -import io.swagger.v3.oas.models.security.SecurityRequirement; | ||
| 8 | import io.swagger.v3.oas.models.security.SecurityScheme; | 7 | import io.swagger.v3.oas.models.security.SecurityScheme; |
| 8 | +import org.springdoc.core.GroupedOpenApi; | ||
| 9 | import org.springdoc.core.*; | 9 | import org.springdoc.core.*; |
| 10 | import org.springdoc.core.customizers.OpenApiBuilderCustomizer; | 10 | import org.springdoc.core.customizers.OpenApiBuilderCustomizer; |
| 11 | import org.springdoc.core.customizers.ServerBaseUrlCustomizer; | 11 | import org.springdoc.core.customizers.ServerBaseUrlCustomizer; |
| @@ -44,21 +44,16 @@ public class YudaoSwaggerAutoConfiguration { | @@ -44,21 +44,16 @@ public class YudaoSwaggerAutoConfiguration { | ||
| 44 | //鉴权组件(随便起名的) | 44 | //鉴权组件(随便起名的) |
| 45 | SecurityScheme securityScheme = new SecurityScheme() | 45 | SecurityScheme securityScheme = new SecurityScheme() |
| 46 | .type(SecurityScheme.Type.APIKEY) | 46 | .type(SecurityScheme.Type.APIKEY) |
| 47 | - .scheme("bearer")//固定写法 | 47 | + .scheme("Bearer")//固定写法 |
| 48 | .bearerFormat("JWT") | 48 | .bearerFormat("JWT") |
| 49 | .in(SecurityScheme.In.HEADER) | 49 | .in(SecurityScheme.In.HEADER) |
| 50 | .name(HttpHeaders.AUTHORIZATION); | 50 | .name(HttpHeaders.AUTHORIZATION); |
| 51 | Components components = new Components() | 51 | Components components = new Components() |
| 52 | - .addSecuritySchemes("Bearer", securityScheme); | ||
| 53 | - | ||
| 54 | - //鉴权限制要求(随便起名的) | ||
| 55 | - SecurityRequirement securityRequirement = new SecurityRequirement() | ||
| 56 | - .addList(HttpHeaders.AUTHORIZATION, Arrays.asList("read", "write")); | 52 | + .addSecuritySchemes("bearer", securityScheme); |
| 57 | 53 | ||
| 58 | return new OpenAPI() | 54 | return new OpenAPI() |
| 59 | .info(info) | 55 | .info(info) |
| 60 | - .components(components) | ||
| 61 | - .addSecurityItem(securityRequirement); | 56 | + .components(components); |
| 62 | } | 57 | } |
| 63 | 58 | ||
| 64 | /** | 59 | /** |
| @@ -92,3 +87,4 @@ public class YudaoSwaggerAutoConfiguration { | @@ -92,3 +87,4 @@ public class YudaoSwaggerAutoConfiguration { | ||
| 92 | } | 87 | } |
| 93 | 88 | ||
| 94 | } | 89 | } |
| 90 | + |
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; | @@ -6,8 +6,8 @@ import cn.iocoder.yudao.framework.operatelog.core.annotations.OperateLog; | ||
| 6 | import com.anji.captcha.model.common.ResponseModel; | 6 | import com.anji.captcha.model.common.ResponseModel; |
| 7 | import com.anji.captcha.model.vo.CaptchaVO; | 7 | import com.anji.captcha.model.vo.CaptchaVO; |
| 8 | import com.anji.captcha.service.CaptchaService; | 8 | import com.anji.captcha.service.CaptchaService; |
| 9 | -import io.swagger.annotations.Api; | ||
| 10 | -import io.swagger.annotations.ApiOperation; | 9 | +import io.swagger.v3.oas.annotations.Operation; |
| 10 | +import io.swagger.v3.oas.annotations.tags.Tag; | ||
| 11 | import org.springframework.web.bind.annotation.PostMapping; | 11 | import org.springframework.web.bind.annotation.PostMapping; |
| 12 | import org.springframework.web.bind.annotation.RequestBody; | 12 | import org.springframework.web.bind.annotation.RequestBody; |
| 13 | import org.springframework.web.bind.annotation.RequestMapping; | 13 | import org.springframework.web.bind.annotation.RequestMapping; |
| @@ -22,7 +22,7 @@ import javax.servlet.http.HttpServletRequest; | @@ -22,7 +22,7 @@ import javax.servlet.http.HttpServletRequest; | ||
| 22 | * | 22 | * |
| 23 | * @author 芋道源码 | 23 | * @author 芋道源码 |
| 24 | */ | 24 | */ |
| 25 | -@Api(tags = "管理后台 - 验证码") | 25 | +@Tag(name = "管理后台 - 验证码") |
| 26 | @RestController("adminCaptchaController") | 26 | @RestController("adminCaptchaController") |
| 27 | @RequestMapping("/system/captcha") | 27 | @RequestMapping("/system/captcha") |
| 28 | public class CaptchaController { | 28 | public class CaptchaController { |
| @@ -31,7 +31,7 @@ public class CaptchaController { | @@ -31,7 +31,7 @@ public class CaptchaController { | ||
| 31 | private CaptchaService captchaService; | 31 | private CaptchaService captchaService; |
| 32 | 32 | ||
| 33 | @PostMapping({"/get"}) | 33 | @PostMapping({"/get"}) |
| 34 | - @ApiOperation("获得验证码") | 34 | + @Operation(summary = "获得验证码") |
| 35 | @PermitAll | 35 | @PermitAll |
| 36 | @OperateLog(enable = false) // 避免 Post 请求被记录操作日志 | 36 | @OperateLog(enable = false) // 避免 Post 请求被记录操作日志 |
| 37 | public ResponseModel get(@RequestBody CaptchaVO data, HttpServletRequest request) { | 37 | public ResponseModel get(@RequestBody CaptchaVO data, HttpServletRequest request) { |
| @@ -41,7 +41,7 @@ public class CaptchaController { | @@ -41,7 +41,7 @@ public class CaptchaController { | ||
| 41 | } | 41 | } |
| 42 | 42 | ||
| 43 | @PostMapping("/check") | 43 | @PostMapping("/check") |
| 44 | - @ApiOperation("校验验证码") | 44 | + @Operation(summary = "校验验证码") |
| 45 | @PermitAll | 45 | @PermitAll |
| 46 | @OperateLog(enable = false) // 避免 Post 请求被记录操作日志 | 46 | @OperateLog(enable = false) // 避免 Post 请求被记录操作日志 |
| 47 | public ResponseModel check(@RequestBody CaptchaVO data, HttpServletRequest request) { | 47 | public ResponseModel check(@RequestBody CaptchaVO data, HttpServletRequest request) { |
yudao-server/src/main/resources/application.yaml
| @@ -38,6 +38,13 @@ springdoc: | @@ -38,6 +38,13 @@ springdoc: | ||
| 38 | show-actuator: true | 38 | show-actuator: true |
| 39 | swagger-ui: | 39 | swagger-ui: |
| 40 | path: /swagger-ui | 40 | path: /swagger-ui |
| 41 | + api-docs: | ||
| 42 | + path: /v3/api-docs | ||
| 43 | + | ||
| 44 | +knife4j: | ||
| 45 | + enable: true | ||
| 46 | + setting: | ||
| 47 | + language: zh_cn | ||
| 41 | 48 | ||
| 42 | # 工作流 Flowable 配置 | 49 | # 工作流 Flowable 配置 |
| 43 | flowable: | 50 | flowable: |
yudao-ui-admin-vue3/.env.dev
| @@ -2,10 +2,10 @@ | @@ -2,10 +2,10 @@ | ||
| 2 | NODE_ENV=production | 2 | NODE_ENV=production |
| 3 | 3 | ||
| 4 | # 请求路径 | 4 | # 请求路径 |
| 5 | -VITE_BASE_URL='http://localhost:48080' | 5 | +VITE_BASE_URL='http://localhost:58080' |
| 6 | 6 | ||
| 7 | # 上传路径 | 7 | # 上传路径 |
| 8 | -VITE_UPLOAD_URL='http://localhost:48080/admin-api/infra/file/upload' | 8 | +VITE_UPLOAD_URL='http://localhost:58080/admin-api/infra/file/upload' |
| 9 | 9 | ||
| 10 | # 接口前缀 | 10 | # 接口前缀 |
| 11 | VITE_API_BASEPATH=/dev-api | 11 | VITE_API_BASEPATH=/dev-api |
yudao-ui-admin-vue3/.env.pro
| @@ -2,10 +2,10 @@ | @@ -2,10 +2,10 @@ | ||
| 2 | NODE_ENV=production | 2 | NODE_ENV=production |
| 3 | 3 | ||
| 4 | # 请求路径 | 4 | # 请求路径 |
| 5 | -VITE_BASE_URL='http://localhost:48080' | 5 | +VITE_BASE_URL='http://localhost:58080' |
| 6 | 6 | ||
| 7 | # 上传路径 | 7 | # 上传路径 |
| 8 | -VITE_UPLOAD_URL='http://localhost:48080/admin-api/infra/file/upload' | 8 | +VITE_UPLOAD_URL='http://localhost:58080/admin-api/infra/file/upload' |
| 9 | 9 | ||
| 10 | # 接口前缀 | 10 | # 接口前缀 |
| 11 | VITE_API_BASEPATH= | 11 | VITE_API_BASEPATH= |
yudao-ui-admin-vue3/.env.test
| @@ -2,10 +2,10 @@ | @@ -2,10 +2,10 @@ | ||
| 2 | NODE_ENV=production | 2 | NODE_ENV=production |
| 3 | 3 | ||
| 4 | # 请求路径 | 4 | # 请求路径 |
| 5 | -VITE_BASE_URL='http://localhost:48080' | 5 | +VITE_BASE_URL='http://localhost:58080' |
| 6 | 6 | ||
| 7 | # 上传路径 | 7 | # 上传路径 |
| 8 | -VITE_UPLOAD_URL='http://localhost:48080/admin-api/infra/file/upload' | 8 | +VITE_UPLOAD_URL='http://localhost:58080/admin-api/infra/file/upload' |
| 9 | 9 | ||
| 10 | # 接口前缀 | 10 | # 接口前缀 |
| 11 | VITE_API_BASEPATH= | 11 | VITE_API_BASEPATH= |