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 | 18 | <!-- 统一依赖管理 --> |
| 19 | 19 | <spring.boot.version>2.7.7</spring.boot.version> |
| 20 | 20 | <!-- Web 相关 --> |
| 21 | - <springdoc.version>1.6.14</springdoc.version> | |
| 22 | 21 | <knife4j.version>4.0.0</knife4j.version> |
| 23 | 22 | <servlet.versoin>2.5</servlet.versoin> |
| 24 | 23 | <!-- DB 相关 --> |
| ... | ... | @@ -170,18 +169,6 @@ |
| 170 | 169 | <version>${knife4j.version}</version> |
| 171 | 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 | 172 | <!-- DB 相关 --> |
| 186 | 173 | <dependency> |
| 187 | 174 | <groupId>cn.iocoder.boot</groupId> | ... | ... |
yudao-framework/yudao-spring-boot-starter-web/pom.xml
| ... | ... | @@ -39,16 +39,6 @@ |
| 39 | 39 | </dependency> |
| 40 | 40 | |
| 41 | 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 | 42 | <groupId>org.springframework.security</groupId> |
| 53 | 43 | <artifactId>spring-security-core</artifactId> |
| 54 | 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 | 4 | import io.swagger.v3.oas.models.OpenAPI; |
| 5 | 5 | import io.swagger.v3.oas.models.info.Info; |
| 6 | 6 | import io.swagger.v3.oas.models.info.License; |
| 7 | -import io.swagger.v3.oas.models.security.SecurityRequirement; | |
| 8 | 7 | import io.swagger.v3.oas.models.security.SecurityScheme; |
| 8 | +import org.springdoc.core.GroupedOpenApi; | |
| 9 | 9 | import org.springdoc.core.*; |
| 10 | 10 | import org.springdoc.core.customizers.OpenApiBuilderCustomizer; |
| 11 | 11 | import org.springdoc.core.customizers.ServerBaseUrlCustomizer; |
| ... | ... | @@ -44,21 +44,16 @@ public class YudaoSwaggerAutoConfiguration { |
| 44 | 44 | //鉴权组件(随便起名的) |
| 45 | 45 | SecurityScheme securityScheme = new SecurityScheme() |
| 46 | 46 | .type(SecurityScheme.Type.APIKEY) |
| 47 | - .scheme("bearer")//固定写法 | |
| 47 | + .scheme("Bearer")//固定写法 | |
| 48 | 48 | .bearerFormat("JWT") |
| 49 | 49 | .in(SecurityScheme.In.HEADER) |
| 50 | 50 | .name(HttpHeaders.AUTHORIZATION); |
| 51 | 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 | 54 | return new OpenAPI() |
| 59 | 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 | 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 | 6 | import com.anji.captcha.model.common.ResponseModel; |
| 7 | 7 | import com.anji.captcha.model.vo.CaptchaVO; |
| 8 | 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 | 11 | import org.springframework.web.bind.annotation.PostMapping; |
| 12 | 12 | import org.springframework.web.bind.annotation.RequestBody; |
| 13 | 13 | import org.springframework.web.bind.annotation.RequestMapping; |
| ... | ... | @@ -22,7 +22,7 @@ import javax.servlet.http.HttpServletRequest; |
| 22 | 22 | * |
| 23 | 23 | * @author 芋道源码 |
| 24 | 24 | */ |
| 25 | -@Api(tags = "管理后台 - 验证码") | |
| 25 | +@Tag(name = "管理后台 - 验证码") | |
| 26 | 26 | @RestController("adminCaptchaController") |
| 27 | 27 | @RequestMapping("/system/captcha") |
| 28 | 28 | public class CaptchaController { |
| ... | ... | @@ -31,7 +31,7 @@ public class CaptchaController { |
| 31 | 31 | private CaptchaService captchaService; |
| 32 | 32 | |
| 33 | 33 | @PostMapping({"/get"}) |
| 34 | - @ApiOperation("获得验证码") | |
| 34 | + @Operation(summary = "获得验证码") | |
| 35 | 35 | @PermitAll |
| 36 | 36 | @OperateLog(enable = false) // 避免 Post 请求被记录操作日志 |
| 37 | 37 | public ResponseModel get(@RequestBody CaptchaVO data, HttpServletRequest request) { |
| ... | ... | @@ -41,7 +41,7 @@ public class CaptchaController { |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | @PostMapping("/check") |
| 44 | - @ApiOperation("校验验证码") | |
| 44 | + @Operation(summary = "校验验证码") | |
| 45 | 45 | @PermitAll |
| 46 | 46 | @OperateLog(enable = false) // 避免 Post 请求被记录操作日志 |
| 47 | 47 | public ResponseModel check(@RequestBody CaptchaVO data, HttpServletRequest request) { | ... | ... |
yudao-server/src/main/resources/application.yaml
yudao-ui-admin-vue3/.env.dev
| ... | ... | @@ -2,10 +2,10 @@ |
| 2 | 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 | 11 | VITE_API_BASEPATH=/dev-api | ... | ... |
yudao-ui-admin-vue3/.env.pro
| ... | ... | @@ -2,10 +2,10 @@ |
| 2 | 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 | 11 | VITE_API_BASEPATH= | ... | ... |
yudao-ui-admin-vue3/.env.test
| ... | ... | @@ -2,10 +2,10 @@ |
| 2 | 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 | 11 | VITE_API_BASEPATH= | ... | ... |