1. 升级springboot版本至2.2.1
2. 修改swagger-bootstrap-ui部分代码,使其支持不同域名间调试
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
package com.hccake.ballcat.admin;
|
package com.hccake.ballcat.admin;
|
||||||
|
|
||||||
import com.hccake.ballcat.commom.log.access.annotation.EnableAccessLog;
|
import com.hccake.ballcat.commom.log.access.annotation.EnableAccessLog;
|
||||||
|
import com.hccake.ballcat.common.swagger.annotation.EnableSwagger2Aggregator;
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
import org.springframework.boot.web.servlet.ServletComponentScan;
|
import org.springframework.boot.web.servlet.ServletComponentScan;
|
||||||
@@ -9,7 +10,7 @@ import org.springframework.boot.web.servlet.ServletComponentScan;
|
|||||||
* @author Hccake
|
* @author Hccake
|
||||||
*/
|
*/
|
||||||
/*@EnableXxlJob*/
|
/*@EnableXxlJob*/
|
||||||
/*@EnableSwagger2Aggregator*/
|
@EnableSwagger2Aggregator
|
||||||
@EnableAccessLog
|
@EnableAccessLog
|
||||||
@ServletComponentScan("com.hccake.ballcat.admin.oauth.filter")
|
@ServletComponentScan("com.hccake.ballcat.admin.oauth.filter")
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
|
|||||||
@@ -55,6 +55,7 @@ public class CustomResourceServerConfigurer extends ResourceServerConfigurerAdap
|
|||||||
"/swagger-resources/**",
|
"/swagger-resources/**",
|
||||||
"/swagger-ui.html**",
|
"/swagger-ui.html**",
|
||||||
"/webjars/**",
|
"/webjars/**",
|
||||||
|
"/bycdao-ui/**",
|
||||||
"favicon.ico").permitAll()
|
"favicon.ico").permitAll()
|
||||||
.anyRequest().authenticated()
|
.anyRequest().authenticated()
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -54,7 +54,7 @@ swagger:
|
|||||||
license: Powered By BallCat
|
license: Powered By BallCat
|
||||||
licenseUrl: http://www.ballcat.cn/
|
licenseUrl: http://www.ballcat.cn/
|
||||||
terms-of-service-url: http://www.ballcat.cn/
|
terms-of-service-url: http://www.ballcat.cn/
|
||||||
host: http://localhost:9090
|
host: http://ballcat-api:9090
|
||||||
contact:
|
contact:
|
||||||
name: Hccake
|
name: Hccake
|
||||||
email: chengbohua@foxmail.com
|
email: chengbohua@foxmail.com
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.hccake.ballcat.common.swagger;
|
|||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -13,6 +14,7 @@ import java.util.List;
|
|||||||
* @date 2019/11/1 19:37
|
* @date 2019/11/1 19:37
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
|
@Component
|
||||||
@ConfigurationProperties("swagger")
|
@ConfigurationProperties("swagger")
|
||||||
public class SwaggerProperties {
|
public class SwaggerProperties {
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ import org.springframework.web.filter.CorsFilter;
|
|||||||
@ConditionalOnProperty(name = "swagger.enabled", havingValue = "true", matchIfMissing = true)
|
@ConditionalOnProperty(name = "swagger.enabled", havingValue = "true", matchIfMissing = true)
|
||||||
public class SwaggerProviderAutoConfiguration {
|
public class SwaggerProviderAutoConfiguration {
|
||||||
|
|
||||||
@Value("${swagger.aggregator.origin: http://localhost:8080}")
|
@Value("${swagger.aggregator.origin:http://localhost:8080}")
|
||||||
private String aggregatorOrigin;
|
private String aggregatorOrigin;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package com.hccake.ballcat.common.swagger;
|
|||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
import springfox.documentation.swagger.web.SwaggerResource;
|
import springfox.documentation.swagger.web.SwaggerResource;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -13,6 +14,7 @@ import java.util.List;
|
|||||||
* @date 2019/11/1 20:05
|
* @date 2019/11/1 20:05
|
||||||
*/
|
*/
|
||||||
@Data
|
@Data
|
||||||
|
@Component
|
||||||
@ConfigurationProperties("swagger.provider")
|
@ConfigurationProperties("swagger.provider")
|
||||||
public class SwaggerProviderProperties {
|
public class SwaggerProviderProperties {
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import java.lang.annotation.*;
|
|||||||
* @author Hccake
|
* @author Hccake
|
||||||
* @version 1.0
|
* @version 1.0
|
||||||
* @date 2019/11/1 19:43
|
* @date 2019/11/1 19:43
|
||||||
* 聚合者的swagger开启注解
|
* 提供者的swagger开启注解
|
||||||
*/
|
*/
|
||||||
@Target({ElementType.TYPE})
|
@Target({ElementType.TYPE})
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
|
|||||||
9
pom.xml
9
pom.xml
@@ -25,7 +25,7 @@
|
|||||||
<maven.compiler.source>1.8</maven.compiler.source>
|
<maven.compiler.source>1.8</maven.compiler.source>
|
||||||
<maven.compiler.target>1.8</maven.compiler.target>
|
<maven.compiler.target>1.8</maven.compiler.target>
|
||||||
|
|
||||||
<spring-boot.version>2.1.8.RELEASE</spring-boot.version>
|
<spring-boot.version>2.2.1.RELEASE</spring-boot.version>
|
||||||
<spring-platform.version>Cairo-SR8</spring-platform.version>
|
<spring-platform.version>Cairo-SR8</spring-platform.version>
|
||||||
<org.mapstruct.version>1.3.0.Final</org.mapstruct.version>
|
<org.mapstruct.version>1.3.0.Final</org.mapstruct.version>
|
||||||
|
|
||||||
@@ -34,7 +34,6 @@
|
|||||||
<simple-cache.version>0.0.4</simple-cache.version>
|
<simple-cache.version>0.0.4</simple-cache.version>
|
||||||
<swagger.core.version>1.5.2</swagger.core.version>
|
<swagger.core.version>1.5.2</swagger.core.version>
|
||||||
<xxl-job.version>2.1.0</xxl-job.version>
|
<xxl-job.version>2.1.0</xxl-job.version>
|
||||||
<spring-security.version>5.1.6.RELEASE</spring-security.version>
|
|
||||||
<spring-security-oauth2.version>2.3.6.RELEASE</spring-security-oauth2.version>
|
<spring-security-oauth2.version>2.3.6.RELEASE</spring-security-oauth2.version>
|
||||||
|
|
||||||
</properties>
|
</properties>
|
||||||
@@ -132,12 +131,6 @@
|
|||||||
<artifactId>spring-security-oauth2</artifactId>
|
<artifactId>spring-security-oauth2</artifactId>
|
||||||
<version>${spring-security-oauth2.version}</version>
|
<version>${spring-security-oauth2.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- spring-security -->
|
|
||||||
<dependency>
|
|
||||||
<groupId>org.springframework.security</groupId>
|
|
||||||
<artifactId>spring-security-core</artifactId>
|
|
||||||
<version>${spring-security.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<!--hutool工具类-->
|
<!--hutool工具类-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>cn.hutool</groupId>
|
<groupId>cn.hutool</groupId>
|
||||||
|
|||||||
Reference in New Issue
Block a user