revert: file

This commit is contained in:
xingyu 2023-01-16 15:15:31 +08:00
parent 1c0d8fc1eb
commit cba69e94df
8 changed files with 23 additions and 43 deletions

View File

@ -18,7 +18,6 @@
<!-- 统一依赖管理 --> <!-- 统一依赖管理 -->
<spring.boot.version>2.7.7</spring.boot.version> <spring.boot.version>2.7.7</spring.boot.version>
<!-- Web 相关 --> <!-- Web 相关 -->
<springdoc.version>1.6.14</springdoc.version>
<knife4j.version>4.0.0</knife4j.version> <knife4j.version>4.0.0</knife4j.version>
<servlet.versoin>2.5</servlet.versoin> <servlet.versoin>2.5</servlet.versoin>
<!-- DB 相关 --> <!-- DB 相关 -->
@ -170,18 +169,6 @@
<version>${knife4j.version}</version> <version>${knife4j.version}</version>
</dependency> </dependency>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
<version>${springdoc.version}</version>
</dependency>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-security</artifactId>
<version>${springdoc.version}</version>
</dependency>
<!-- DB 相关 --> <!-- DB 相关 -->
<dependency> <dependency>
<groupId>cn.iocoder.boot</groupId> <groupId>cn.iocoder.boot</groupId>

View File

@ -38,16 +38,6 @@
<artifactId>knife4j-openapi3-spring-boot-starter</artifactId> <artifactId>knife4j-openapi3-spring-boot-starter</artifactId>
</dependency> </dependency>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-ui</artifactId>
</dependency>
<dependency>
<groupId>org.springdoc</groupId>
<artifactId>springdoc-openapi-security</artifactId>
</dependency>
<dependency> <dependency>
<groupId>org.springframework.security</groupId> <groupId>org.springframework.security</groupId>
<artifactId>spring-security-core</artifactId> <artifactId>spring-security-core</artifactId>

View File

@ -4,8 +4,8 @@ import io.swagger.v3.oas.models.Components;
import io.swagger.v3.oas.models.OpenAPI; import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info; import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License; 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 io.swagger.v3.oas.models.security.SecurityScheme;
import org.springdoc.core.GroupedOpenApi;
import org.springdoc.core.*; import org.springdoc.core.*;
import org.springdoc.core.customizers.OpenApiBuilderCustomizer; import org.springdoc.core.customizers.OpenApiBuilderCustomizer;
import org.springdoc.core.customizers.ServerBaseUrlCustomizer; import org.springdoc.core.customizers.ServerBaseUrlCustomizer;
@ -44,21 +44,16 @@ public class YudaoSwaggerAutoConfiguration {
//鉴权组件(随便起名的) //鉴权组件(随便起名的)
SecurityScheme securityScheme = new SecurityScheme() SecurityScheme securityScheme = new SecurityScheme()
.type(SecurityScheme.Type.APIKEY) .type(SecurityScheme.Type.APIKEY)
.scheme("bearer")//固定写法 .scheme("Bearer")//固定写法
.bearerFormat("JWT") .bearerFormat("JWT")
.in(SecurityScheme.In.HEADER) .in(SecurityScheme.In.HEADER)
.name(HttpHeaders.AUTHORIZATION); .name(HttpHeaders.AUTHORIZATION);
Components components = new Components() Components components = new Components()
.addSecuritySchemes("Bearer", securityScheme); .addSecuritySchemes("bearer", securityScheme);
//鉴权限制要求(随便起名的)
SecurityRequirement securityRequirement = new SecurityRequirement()
.addList(HttpHeaders.AUTHORIZATION, Arrays.asList("read", "write"));
return new OpenAPI() return new OpenAPI()
.info(info) .info(info)
.components(components) .components(components);
.addSecurityItem(securityRequirement);
} }
/** /**
@ -92,3 +87,4 @@ public class YudaoSwaggerAutoConfiguration {
} }
} }

View File

@ -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.common.ResponseModel;
import com.anji.captcha.model.vo.CaptchaVO; import com.anji.captcha.model.vo.CaptchaVO;
import com.anji.captcha.service.CaptchaService; import com.anji.captcha.service.CaptchaService;
import io.swagger.annotations.Api; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.annotations.ApiOperation; import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
@ -22,7 +22,7 @@ import javax.servlet.http.HttpServletRequest;
* *
* @author 芋道源码 * @author 芋道源码
*/ */
@Api(tags = "管理后台 - 验证码") @Tag(name = "管理后台 - 验证码")
@RestController("adminCaptchaController") @RestController("adminCaptchaController")
@RequestMapping("/system/captcha") @RequestMapping("/system/captcha")
public class CaptchaController { public class CaptchaController {
@ -31,7 +31,7 @@ public class CaptchaController {
private CaptchaService captchaService; private CaptchaService captchaService;
@PostMapping({"/get"}) @PostMapping({"/get"})
@ApiOperation("获得验证码") @Operation(summary = "获得验证码")
@PermitAll @PermitAll
@OperateLog(enable = false) // 避免 Post 请求被记录操作日志 @OperateLog(enable = false) // 避免 Post 请求被记录操作日志
public ResponseModel get(@RequestBody CaptchaVO data, HttpServletRequest request) { public ResponseModel get(@RequestBody CaptchaVO data, HttpServletRequest request) {
@ -41,7 +41,7 @@ public class CaptchaController {
} }
@PostMapping("/check") @PostMapping("/check")
@ApiOperation("校验验证码") @Operation(summary = "校验验证码")
@PermitAll @PermitAll
@OperateLog(enable = false) // 避免 Post 请求被记录操作日志 @OperateLog(enable = false) // 避免 Post 请求被记录操作日志
public ResponseModel check(@RequestBody CaptchaVO data, HttpServletRequest request) { public ResponseModel check(@RequestBody CaptchaVO data, HttpServletRequest request) {

View File

@ -38,6 +38,13 @@ springdoc:
show-actuator: true show-actuator: true
swagger-ui: swagger-ui:
path: /swagger-ui path: /swagger-ui
api-docs:
path: /v3/api-docs
knife4j:
enable: true
setting:
language: zh_cn
# 工作流 Flowable 配置 # 工作流 Flowable 配置
flowable: flowable:

View File

@ -2,10 +2,10 @@
NODE_ENV=production 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 VITE_API_BASEPATH=/dev-api

View File

@ -2,10 +2,10 @@
NODE_ENV=production 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= VITE_API_BASEPATH=

View File

@ -2,10 +2,10 @@
NODE_ENV=production 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= VITE_API_BASEPATH=