一般生产环境是不能放开swagger的,这样接口暴露在外网很不安全。
定义了只有dev和test环境才会加载swagger,所以如果你部署起来需要放开端口,请把环境设置成test,prod为了安全性是强制不让开的
blade-tool的blade-core-swagger有个SwaggerAutoConfiguration配置,如下:
/**
 * swagger配置
 *
 * @author Chill
 */
@Configuration
@EnableSwagger2
@EnableSwaggerBootstrapUI
@Profile({"dev", "test"})
@EnableConfigurationProperties(SwaggerProperties.class)
public class SwaggerAutoConfiguration