mirror of
https://gitee.com/huangge1199_admin/vue-pro.git
synced 2024-11-23 07:41:53 +08:00
swagger请求前缀加入配置。
This commit is contained in:
parent
922f61e05b
commit
5434ceb1a3
@ -33,9 +33,13 @@ public class SwaggerConfig
|
||||
@Autowired
|
||||
private RuoYiConfig ruoyiConfig;
|
||||
|
||||
/** Swagger开关配置 */
|
||||
@Value("${swagger.enable}")
|
||||
private boolean swaggerEnable;
|
||||
/** 是否开启swagger */
|
||||
@Value("${swagger.enabled}")
|
||||
private boolean enabled;
|
||||
|
||||
/** 设置请求的统一前缀 */
|
||||
@Value("${swagger.pathMapping}")
|
||||
private String pathMapping;
|
||||
|
||||
/**
|
||||
* 创建API
|
||||
@ -45,8 +49,7 @@ public class SwaggerConfig
|
||||
{
|
||||
return new Docket(DocumentationType.SWAGGER_2)
|
||||
// 是否启用Swagger
|
||||
.enable(swaggerEnable)
|
||||
.pathMapping("/dev-api")
|
||||
.enable(enabled)
|
||||
// 用来创建该API的基本信息,展示在文档的页面中(自定义展示的信息)
|
||||
.apiInfo(apiInfo())
|
||||
// 设置哪些接口暴露给Swagger展示
|
||||
@ -60,7 +63,8 @@ public class SwaggerConfig
|
||||
.build()
|
||||
/* 设置安全模式,swagger可以设置访问token */
|
||||
.securitySchemes(securitySchemes())
|
||||
.securityContexts(securityContexts());
|
||||
.securityContexts(securityContexts())
|
||||
.pathMapping(pathMapping);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -102,7 +102,10 @@ pagehelper:
|
||||
|
||||
# Swagger配置
|
||||
swagger:
|
||||
enable: true
|
||||
# 是否开启swagger
|
||||
enabled: true
|
||||
# 请求前缀
|
||||
pathMapping: /dev-api
|
||||
|
||||
# 防止XSS攻击
|
||||
xss:
|
||||
|
Loading…
Reference in New Issue
Block a user