mirror of
https://github.com/chillzhuang/SpringBlade.git
synced 2024-11-01 08:09:30 +08:00
🎉 3.0.2.RELEASE 支持 Nacos2.0 长链接特性
This commit is contained in:
parent
57882206d3
commit
917ca30b43
@ -1,9 +1,9 @@
|
|||||||
<p align="center">
|
<p align="center">
|
||||||
<img src="https://img.shields.io/badge/Release-V3.0.1-green.svg" alt="Downloads">
|
<img src="https://img.shields.io/badge/Release-V3.0.2-green.svg" alt="Downloads">
|
||||||
<img src="https://img.shields.io/badge/JDK-1.8+-green.svg" alt="Build Status">
|
<img src="https://img.shields.io/badge/JDK-1.8+-green.svg" alt="Build Status">
|
||||||
<img src="https://img.shields.io/badge/license-Apache%202-blue.svg" alt="Build Status">
|
<img src="https://img.shields.io/badge/license-Apache%202-blue.svg" alt="Build Status">
|
||||||
<img src="https://img.shields.io/badge/Spring%20Cloud-2020-blue.svg" alt="Coverage Status">
|
<img src="https://img.shields.io/badge/Spring%20Cloud-2020-blue.svg" alt="Coverage Status">
|
||||||
<img src="https://img.shields.io/badge/Spring%20Boot-2.4.2-blue.svg" alt="Downloads">
|
<img src="https://img.shields.io/badge/Spring%20Boot-2.4.4-blue.svg" alt="Downloads">
|
||||||
<a target="_blank" href="https://bladex.vip">
|
<a target="_blank" href="https://bladex.vip">
|
||||||
<img src="https://img.shields.io/badge/Author-Small%20Chill-ff69b4.svg" alt="Downloads">
|
<img src="https://img.shields.io/badge/Author-Small%20Chill-ff69b4.svg" alt="Downloads">
|
||||||
</a>
|
</a>
|
||||||
@ -28,6 +28,9 @@
|
|||||||
## 架构图
|
## 架构图
|
||||||
<img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/springblade-framework.png"/>
|
<img src="https://gitee.com/smallc/SpringBlade/raw/master/pic/springblade-framework.png"/>
|
||||||
|
|
||||||
|
## 趋势图
|
||||||
|
<a href="https://whnb.wang/smallc/SpringBlade" rel="nofollow"><img src="https://whnb.wang/img/smallc/SpringBlade" alt="Stargazers over time"></a>
|
||||||
|
|
||||||
## 工程结构
|
## 工程结构
|
||||||
```
|
```
|
||||||
SpringBlade
|
SpringBlade
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>SpringBlade</artifactId>
|
<artifactId>SpringBlade</artifactId>
|
||||||
<groupId>org.springblade</groupId>
|
<groupId>org.springblade</groupId>
|
||||||
<version>3.0.1</version>
|
<version>3.0.2</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>blade-auth</artifactId>
|
<artifactId>blade-auth</artifactId>
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>SpringBlade</artifactId>
|
<artifactId>SpringBlade</artifactId>
|
||||||
<groupId>org.springblade</groupId>
|
<groupId>org.springblade</groupId>
|
||||||
<version>3.0.1</version>
|
<version>3.0.2</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>SpringBlade</artifactId>
|
<artifactId>SpringBlade</artifactId>
|
||||||
<groupId>org.springblade</groupId>
|
<groupId>org.springblade</groupId>
|
||||||
<version>3.0.1</version>
|
<version>3.0.2</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
@ -74,13 +74,30 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alibaba.cloud</groupId>
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
<artifactId>spring-cloud-starter-alibaba-nacos-discovery</artifactId>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>com.alibaba.nacos</groupId>
|
||||||
|
<artifactId>nacos-client</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
<version>${alibaba.cloud.version}</version>
|
<version>${alibaba.cloud.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.alibaba.cloud</groupId>
|
<groupId>com.alibaba.cloud</groupId>
|
||||||
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
<artifactId>spring-cloud-starter-alibaba-nacos-config</artifactId>
|
||||||
|
<exclusions>
|
||||||
|
<exclusion>
|
||||||
|
<groupId>com.alibaba.nacos</groupId>
|
||||||
|
<artifactId>nacos-client</artifactId>
|
||||||
|
</exclusion>
|
||||||
|
</exclusions>
|
||||||
<version>${alibaba.cloud.version}</version>
|
<version>${alibaba.cloud.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba.nacos</groupId>
|
||||||
|
<artifactId>nacos-client</artifactId>
|
||||||
|
<version>${alibaba.nacos.version}</version>
|
||||||
|
</dependency>
|
||||||
<!-- JWT -->
|
<!-- JWT -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.jsonwebtoken</groupId>
|
<groupId>io.jsonwebtoken</groupId>
|
||||||
|
@ -20,7 +20,18 @@ import lombok.AllArgsConstructor;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springblade.gateway.props.AuthProperties;
|
import org.springblade.gateway.props.AuthProperties;
|
||||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.http.HttpHeaders;
|
||||||
|
import org.springframework.http.HttpMethod;
|
||||||
|
import org.springframework.http.HttpStatus;
|
||||||
|
import org.springframework.http.server.reactive.ServerHttpRequest;
|
||||||
|
import org.springframework.http.server.reactive.ServerHttpResponse;
|
||||||
|
import org.springframework.web.cors.reactive.CorsUtils;
|
||||||
|
import org.springframework.web.server.ServerWebExchange;
|
||||||
|
import org.springframework.web.server.WebFilter;
|
||||||
|
import org.springframework.web.server.WebFilterChain;
|
||||||
|
import reactor.core.publisher.Mono;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 路由配置信息
|
* 路由配置信息
|
||||||
@ -33,4 +44,38 @@ import org.springframework.context.annotation.Configuration;
|
|||||||
@EnableConfigurationProperties({AuthProperties.class})
|
@EnableConfigurationProperties({AuthProperties.class})
|
||||||
public class RouterFunctionConfiguration {
|
public class RouterFunctionConfiguration {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 这里为支持的请求头,如果有自定义的header字段请自己添加
|
||||||
|
*/
|
||||||
|
private static final String ALLOWED_HEADERS = "X-Requested-With, Tenant-Id, Blade-Auth, Content-Type, Authorization, credential, X-XSRF-TOKEN, token, username, client, knfie4j-gateway-request, request-origion";
|
||||||
|
private static final String ALLOWED_METHODS = "GET,POST,PUT,DELETE,OPTIONS,HEAD";
|
||||||
|
private static final String ALLOWED_ORIGIN = "*";
|
||||||
|
private static final String ALLOWED_EXPOSE = "*";
|
||||||
|
private static final String MAX_AGE = "18000L";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 跨域配置
|
||||||
|
*/
|
||||||
|
@Bean
|
||||||
|
public WebFilter corsFilter() {
|
||||||
|
return (ServerWebExchange ctx, WebFilterChain chain) -> {
|
||||||
|
ServerHttpRequest request = ctx.getRequest();
|
||||||
|
if (CorsUtils.isCorsRequest(request)) {
|
||||||
|
ServerHttpResponse response = ctx.getResponse();
|
||||||
|
HttpHeaders headers = response.getHeaders();
|
||||||
|
headers.add("Access-Control-Allow-Headers", ALLOWED_HEADERS);
|
||||||
|
headers.add("Access-Control-Allow-Methods", ALLOWED_METHODS);
|
||||||
|
headers.add("Access-Control-Allow-Origin", ALLOWED_ORIGIN);
|
||||||
|
headers.add("Access-Control-Expose-Headers", ALLOWED_EXPOSE);
|
||||||
|
headers.add("Access-Control-Max-Age", MAX_AGE);
|
||||||
|
headers.add("Access-Control-Allow-Credentials", "true");
|
||||||
|
if (request.getMethod() == HttpMethod.OPTIONS) {
|
||||||
|
response.setStatusCode(HttpStatus.OK);
|
||||||
|
return Mono.empty();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return chain.filter(ctx);
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -32,6 +32,7 @@ import org.springframework.core.io.buffer.DataBuffer;
|
|||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.server.reactive.ServerHttpResponse;
|
import org.springframework.http.server.reactive.ServerHttpResponse;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.util.AntPathMatcher;
|
||||||
import org.springframework.web.server.ServerWebExchange;
|
import org.springframework.web.server.ServerWebExchange;
|
||||||
import reactor.core.publisher.Flux;
|
import reactor.core.publisher.Flux;
|
||||||
import reactor.core.publisher.Mono;
|
import reactor.core.publisher.Mono;
|
||||||
@ -49,6 +50,7 @@ import java.nio.charset.StandardCharsets;
|
|||||||
public class AuthFilter implements GlobalFilter, Ordered {
|
public class AuthFilter implements GlobalFilter, Ordered {
|
||||||
private final AuthProperties authProperties;
|
private final AuthProperties authProperties;
|
||||||
private final ObjectMapper objectMapper;
|
private final ObjectMapper objectMapper;
|
||||||
|
private final AntPathMatcher antPathMatcher = new AntPathMatcher();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
|
public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
|
||||||
@ -72,8 +74,8 @@ public class AuthFilter implements GlobalFilter, Ordered {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private boolean isSkip(String path) {
|
private boolean isSkip(String path) {
|
||||||
return AuthProvider.getDefaultSkipUrl().stream().map(url -> url.replace(AuthProvider.TARGET, AuthProvider.REPLACEMENT)).anyMatch(path::contains)
|
return AuthProvider.getDefaultSkipUrl().stream().anyMatch(pattern -> antPathMatcher.match(pattern, path))
|
||||||
|| authProperties.getSkipUrl().stream().map(url -> url.replace(AuthProvider.TARGET, AuthProvider.REPLACEMENT)).anyMatch(path::contains);
|
|| authProperties.getSkipUrl().stream().anyMatch(pattern -> antPathMatcher.match(pattern, path));
|
||||||
}
|
}
|
||||||
|
|
||||||
private Mono<Void> unAuth(ServerHttpResponse resp, String msg) {
|
private Mono<Void> unAuth(ServerHttpResponse resp, String msg) {
|
||||||
|
@ -0,0 +1,45 @@
|
|||||||
|
package org.springblade.gateway.filter;
|
||||||
|
|
||||||
|
import org.springframework.cloud.gateway.filter.GatewayFilterChain;
|
||||||
|
import org.springframework.cloud.gateway.filter.GlobalFilter;
|
||||||
|
import org.springframework.core.Ordered;
|
||||||
|
import org.springframework.http.server.reactive.ServerHttpRequest;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
import org.springframework.web.server.ServerWebExchange;
|
||||||
|
import reactor.core.publisher.Mono;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import static org.springframework.cloud.gateway.support.ServerWebExchangeUtils.GATEWAY_REQUEST_URL_ATTR;
|
||||||
|
import static org.springframework.cloud.gateway.support.ServerWebExchangeUtils.addOriginalRequestUrl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* request过滤器
|
||||||
|
*
|
||||||
|
* @author lengleng
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
public class RequestFilter implements GlobalFilter, Ordered {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
|
||||||
|
ServerHttpRequest request = exchange.getRequest();
|
||||||
|
addOriginalRequestUrl(exchange, request.getURI());
|
||||||
|
String rawPath = request.getURI().getRawPath();
|
||||||
|
String newPath = "/" + Arrays.stream(StringUtils.tokenizeToStringArray(rawPath, "/"))
|
||||||
|
.skip(1L).collect(Collectors.joining("/"));
|
||||||
|
ServerHttpRequest newRequest = request.mutate()
|
||||||
|
.path(newPath)
|
||||||
|
.build();
|
||||||
|
exchange.getAttributes().put(GATEWAY_REQUEST_URL_ATTR, newRequest.getURI());
|
||||||
|
return chain.filter(exchange.mutate().request(newRequest.mutate().build()).build());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getOrder() {
|
||||||
|
return -1000;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -27,34 +27,32 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public class AuthProvider {
|
public class AuthProvider {
|
||||||
|
|
||||||
public static String TARGET = "/**";
|
|
||||||
public static String REPLACEMENT = "";
|
|
||||||
public static String AUTH_KEY = TokenConstant.HEADER;
|
public static String AUTH_KEY = TokenConstant.HEADER;
|
||||||
private static final List<String> defaultSkipUrl = new ArrayList<>();
|
private static final List<String> DEFAULT_SKIP_URL = new ArrayList<>();
|
||||||
|
|
||||||
static {
|
static {
|
||||||
defaultSkipUrl.add("/example");
|
DEFAULT_SKIP_URL.add("/example");
|
||||||
defaultSkipUrl.add("/token/**");
|
DEFAULT_SKIP_URL.add("/token/**");
|
||||||
defaultSkipUrl.add("/captcha/**");
|
DEFAULT_SKIP_URL.add("/captcha/**");
|
||||||
defaultSkipUrl.add("/actuator/health/**");
|
DEFAULT_SKIP_URL.add("/actuator/health/**");
|
||||||
defaultSkipUrl.add("/v2/api-docs/**");
|
DEFAULT_SKIP_URL.add("/v2/api-docs/**");
|
||||||
defaultSkipUrl.add("/auth/**");
|
DEFAULT_SKIP_URL.add("/auth/**");
|
||||||
defaultSkipUrl.add("/oauth/**");
|
DEFAULT_SKIP_URL.add("/oauth/**");
|
||||||
defaultSkipUrl.add("/log/**");
|
DEFAULT_SKIP_URL.add("/log/**");
|
||||||
defaultSkipUrl.add("/menu/routes");
|
DEFAULT_SKIP_URL.add("/menu/routes");
|
||||||
defaultSkipUrl.add("/menu/auth-routes");
|
DEFAULT_SKIP_URL.add("/menu/auth-routes");
|
||||||
defaultSkipUrl.add("/tenant/info");
|
DEFAULT_SKIP_URL.add("/tenant/info");
|
||||||
defaultSkipUrl.add("/order/create/**");
|
DEFAULT_SKIP_URL.add("/order/create/**");
|
||||||
defaultSkipUrl.add("/storage/deduct/**");
|
DEFAULT_SKIP_URL.add("/storage/deduct/**");
|
||||||
defaultSkipUrl.add("/error/**");
|
DEFAULT_SKIP_URL.add("/error/**");
|
||||||
defaultSkipUrl.add("/assets/**");
|
DEFAULT_SKIP_URL.add("/assets/**");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 默认无需鉴权的API
|
* 默认无需鉴权的API
|
||||||
*/
|
*/
|
||||||
public static List<String> getDefaultSkipUrl() {
|
public static List<String> getDefaultSkipUrl() {
|
||||||
return defaultSkipUrl;
|
return DEFAULT_SKIP_URL;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>blade-ops</artifactId>
|
<artifactId>blade-ops</artifactId>
|
||||||
<groupId>org.springblade</groupId>
|
<groupId>org.springblade</groupId>
|
||||||
<version>3.0.1</version>
|
<version>3.0.2</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.springblade</groupId>
|
<groupId>org.springblade</groupId>
|
||||||
<artifactId>blade-ops</artifactId>
|
<artifactId>blade-ops</artifactId>
|
||||||
<version>3.0.1</version>
|
<version>3.0.2</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.springblade</groupId>
|
<groupId>org.springblade</groupId>
|
||||||
<artifactId>blade-ops</artifactId>
|
<artifactId>blade-ops</artifactId>
|
||||||
<version>3.0.1</version>
|
<version>3.0.2</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>blade-ops</artifactId>
|
<artifactId>blade-ops</artifactId>
|
||||||
<groupId>org.springblade</groupId>
|
<groupId>org.springblade</groupId>
|
||||||
<version>3.0.1</version>
|
<version>3.0.2</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>blade-ops</artifactId>
|
<artifactId>blade-ops</artifactId>
|
||||||
<groupId>org.springblade</groupId>
|
<groupId>org.springblade</groupId>
|
||||||
<version>3.0.1</version>
|
<version>3.0.2</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>blade-ops</artifactId>
|
<artifactId>blade-ops</artifactId>
|
||||||
<groupId>org.springblade</groupId>
|
<groupId>org.springblade</groupId>
|
||||||
<version>3.0.1</version>
|
<version>3.0.2</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>blade-ops</artifactId>
|
<artifactId>blade-ops</artifactId>
|
||||||
<groupId>org.springblade</groupId>
|
<groupId>org.springblade</groupId>
|
||||||
<version>3.0.1</version>
|
<version>3.0.2</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
@ -5,11 +5,13 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>SpringBlade</artifactId>
|
<artifactId>SpringBlade</artifactId>
|
||||||
<groupId>org.springblade</groupId>
|
<groupId>org.springblade</groupId>
|
||||||
<version>3.0.1</version>
|
<version>3.0.2</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<artifactId>blade-ops</artifactId>
|
<artifactId>blade-ops</artifactId>
|
||||||
|
<name>${project.artifactId}</name>
|
||||||
|
<version>3.0.2</version>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<modules>
|
<modules>
|
||||||
<module>blade-admin</module>
|
<module>blade-admin</module>
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>blade-service-api</artifactId>
|
<artifactId>blade-service-api</artifactId>
|
||||||
<groupId>org.springblade</groupId>
|
<groupId>org.springblade</groupId>
|
||||||
<version>3.0.1</version>
|
<version>3.0.2</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>blade-service-api</artifactId>
|
<artifactId>blade-service-api</artifactId>
|
||||||
<groupId>org.springblade</groupId>
|
<groupId>org.springblade</groupId>
|
||||||
<version>3.0.1</version>
|
<version>3.0.2</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>blade-service-api</artifactId>
|
<artifactId>blade-service-api</artifactId>
|
||||||
<groupId>org.springblade</groupId>
|
<groupId>org.springblade</groupId>
|
||||||
<version>3.0.1</version>
|
<version>3.0.2</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>blade-service-api</artifactId>
|
<artifactId>blade-service-api</artifactId>
|
||||||
<groupId>org.springblade</groupId>
|
<groupId>org.springblade</groupId>
|
||||||
<version>3.0.1</version>
|
<version>3.0.2</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>blade-service-api</artifactId>
|
<artifactId>blade-service-api</artifactId>
|
||||||
<groupId>org.springblade</groupId>
|
<groupId>org.springblade</groupId>
|
||||||
<version>3.0.1</version>
|
<version>3.0.2</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
@ -5,13 +5,13 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>SpringBlade</artifactId>
|
<artifactId>SpringBlade</artifactId>
|
||||||
<groupId>org.springblade</groupId>
|
<groupId>org.springblade</groupId>
|
||||||
<version>3.0.1</version>
|
<version>3.0.2</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
<artifactId>blade-service-api</artifactId>
|
<artifactId>blade-service-api</artifactId>
|
||||||
<name>${project.artifactId}</name>
|
<name>${project.artifactId}</name>
|
||||||
<version>3.0.1</version>
|
<version>3.0.2</version>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<description>SpringBlade 微服务API集合</description>
|
<description>SpringBlade 微服务API集合</description>
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>blade-service</artifactId>
|
<artifactId>blade-service</artifactId>
|
||||||
<groupId>org.springblade</groupId>
|
<groupId>org.springblade</groupId>
|
||||||
<version>3.0.1</version>
|
<version>3.0.2</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.springblade</groupId>
|
<groupId>org.springblade</groupId>
|
||||||
<artifactId>blade-service</artifactId>
|
<artifactId>blade-service</artifactId>
|
||||||
<version>3.0.1</version>
|
<version>3.0.2</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>blade-service</artifactId>
|
<artifactId>blade-service</artifactId>
|
||||||
<groupId>org.springblade</groupId>
|
<groupId>org.springblade</groupId>
|
||||||
<version>3.0.1</version>
|
<version>3.0.2</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>blade-service</artifactId>
|
<artifactId>blade-service</artifactId>
|
||||||
<groupId>org.springblade</groupId>
|
<groupId>org.springblade</groupId>
|
||||||
<version>3.0.1</version>
|
<version>3.0.2</version>
|
||||||
</parent>
|
</parent>
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<artifactId>blade-service</artifactId>
|
<artifactId>blade-service</artifactId>
|
||||||
<groupId>org.springblade</groupId>
|
<groupId>org.springblade</groupId>
|
||||||
<version>3.0.1</version>
|
<version>3.0.2</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
@ -7,12 +7,12 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.springblade</groupId>
|
<groupId>org.springblade</groupId>
|
||||||
<artifactId>SpringBlade</artifactId>
|
<artifactId>SpringBlade</artifactId>
|
||||||
<version>3.0.1</version>
|
<version>3.0.2</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<artifactId>blade-service</artifactId>
|
<artifactId>blade-service</artifactId>
|
||||||
<name>${project.artifactId}</name>
|
<name>${project.artifactId}</name>
|
||||||
<version>3.0.1</version>
|
<version>3.0.2</version>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<description>SpringBlade 微服务集合</description>
|
<description>SpringBlade 微服务集合</description>
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ CMD java -Djava.security.egd=file:/dev/./urandom -jar app.jar --spring.profiles.
|
|||||||
###5. 在工程根目录的docker-compose.yml下加入配置,内容可参考如下
|
###5. 在工程根目录的docker-compose.yml下加入配置,内容可参考如下
|
||||||
```
|
```
|
||||||
blade-gateway:
|
blade-gateway:
|
||||||
image: "${REGISTER}/blade/blade-gateway:${TAG}"
|
image: "${REGISTER}/blade-gateway:${TAG}"
|
||||||
ports:
|
ports:
|
||||||
- 80:80
|
- 80:80
|
||||||
networks:
|
networks:
|
||||||
|
@ -69,7 +69,7 @@ knife4j:
|
|||||||
swagger:
|
swagger:
|
||||||
title: SpringBlade 接口文档系统
|
title: SpringBlade 接口文档系统
|
||||||
description: SpringBlade 接口文档系统
|
description: SpringBlade 接口文档系统
|
||||||
version: 3.0.1
|
version: 3.0.2
|
||||||
license: Powered By SpringBlade
|
license: Powered By SpringBlade
|
||||||
licenseUrl: https://bladex.vip
|
licenseUrl: https://bladex.vip
|
||||||
terms-of-service-url: https://bladex.vip
|
terms-of-service-url: https://bladex.vip
|
||||||
|
13
pom.xml
13
pom.xml
@ -5,12 +5,12 @@
|
|||||||
|
|
||||||
<groupId>org.springblade</groupId>
|
<groupId>org.springblade</groupId>
|
||||||
<artifactId>SpringBlade</artifactId>
|
<artifactId>SpringBlade</artifactId>
|
||||||
<version>3.0.1</version>
|
<version>3.0.2</version>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<blade.tool.version>3.0.1</blade.tool.version>
|
<blade.tool.version>3.0.2</blade.tool.version>
|
||||||
<blade.project.version>3.0.1</blade.project.version>
|
<blade.project.version>3.0.2</blade.project.version>
|
||||||
|
|
||||||
<java.version>1.8</java.version>
|
<java.version>1.8</java.version>
|
||||||
<maven.plugin.version>3.8.1</maven.plugin.version>
|
<maven.plugin.version>3.8.1</maven.plugin.version>
|
||||||
@ -21,12 +21,13 @@
|
|||||||
<captcha.version>1.6.2</captcha.version>
|
<captcha.version>1.6.2</captcha.version>
|
||||||
<easyexcel.version>2.2.6</easyexcel.version>
|
<easyexcel.version>2.2.6</easyexcel.version>
|
||||||
<mica.auto.version>1.2.5</mica.auto.version>
|
<mica.auto.version>1.2.5</mica.auto.version>
|
||||||
<alibaba.cloud.version>2.2.5.RC2</alibaba.cloud.version>
|
<alibaba.cloud.version>2.2.5.RELEASE</alibaba.cloud.version>
|
||||||
|
<alibaba.nacos.version>2.0.0</alibaba.nacos.version>
|
||||||
<spring.boot.admin.version>2.3.1</spring.boot.admin.version>
|
<spring.boot.admin.version>2.3.1</spring.boot.admin.version>
|
||||||
<spring.plugin.version>2.0.0.RELEASE</spring.plugin.version>
|
<spring.plugin.version>2.0.0.RELEASE</spring.plugin.version>
|
||||||
|
|
||||||
<spring.boot.version>2.4.2</spring.boot.version>
|
<spring.boot.version>2.4.4</spring.boot.version>
|
||||||
<spring.cloud.version>2020.0.1</spring.cloud.version>
|
<spring.cloud.version>2020.0.2</spring.cloud.version>
|
||||||
<spring.platform.version>Cairo-SR8</spring.platform.version>
|
<spring.platform.version>Cairo-SR8</spring.platform.version>
|
||||||
|
|
||||||
<!-- 推荐使用Harbor -->
|
<!-- 推荐使用Harbor -->
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
REGISTER=192.168.0.157/blade
|
REGISTER=192.168.0.157/blade
|
||||||
TAG=3.0.1
|
TAG=3.0.2
|
||||||
|
@ -10,6 +10,8 @@ port(){
|
|||||||
firewall-cmd --add-port=88/tcp --permanent
|
firewall-cmd --add-port=88/tcp --permanent
|
||||||
firewall-cmd --add-port=8000/tcp --permanent
|
firewall-cmd --add-port=8000/tcp --permanent
|
||||||
firewall-cmd --add-port=8848/tcp --permanent
|
firewall-cmd --add-port=8848/tcp --permanent
|
||||||
|
firewall-cmd --add-port=9848/tcp --permanent
|
||||||
|
firewall-cmd --add-port=9849/tcp --permanent
|
||||||
firewall-cmd --add-port=8858/tcp --permanent
|
firewall-cmd --add-port=8858/tcp --permanent
|
||||||
firewall-cmd --add-port=3306/tcp --permanent
|
firewall-cmd --add-port=3306/tcp --permanent
|
||||||
firewall-cmd --add-port=3379/tcp --permanent
|
firewall-cmd --add-port=3379/tcp --permanent
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
version: '3'
|
version: '3'
|
||||||
services:
|
services:
|
||||||
nacos:
|
nacos:
|
||||||
image: nacos/nacos-server:1.3.2
|
image: nacos/nacos-server:2.0.0
|
||||||
hostname: "nacos-standalone"
|
hostname: "nacos-standalone"
|
||||||
environment:
|
environment:
|
||||||
- MODE=standalone
|
- MODE=standalone
|
||||||
@ -10,12 +10,14 @@ services:
|
|||||||
- /docker/nacos/init.d/custom.properties:/home/nacos/init.d/custom.properties
|
- /docker/nacos/init.d/custom.properties:/home/nacos/init.d/custom.properties
|
||||||
ports:
|
ports:
|
||||||
- 8848:8848
|
- 8848:8848
|
||||||
|
- 9848:9848
|
||||||
|
- 9849:9849
|
||||||
networks:
|
networks:
|
||||||
blade_net:
|
blade_net:
|
||||||
ipv4_address: 172.30.0.48
|
ipv4_address: 172.30.0.48
|
||||||
|
|
||||||
sentinel:
|
sentinel:
|
||||||
image: bladex/sentinel-dashboard:1.7.2
|
image: bladex/sentinel-dashboard:1.8.0
|
||||||
hostname: "sentinel"
|
hostname: "sentinel"
|
||||||
ports:
|
ports:
|
||||||
- 8858:8858
|
- 8858:8858
|
||||||
@ -63,7 +65,7 @@ services:
|
|||||||
- blade_net
|
- blade_net
|
||||||
|
|
||||||
blade-admin:
|
blade-admin:
|
||||||
image: "${REGISTER}/blade/blade-admin:${TAG}"
|
image: "${REGISTER}/blade-admin:${TAG}"
|
||||||
ports:
|
ports:
|
||||||
- 7002:7002
|
- 7002:7002
|
||||||
privileged: true
|
privileged: true
|
||||||
@ -72,7 +74,7 @@ services:
|
|||||||
- blade_net
|
- blade_net
|
||||||
|
|
||||||
blade-swagger:
|
blade-swagger:
|
||||||
image: "${REGISTER}/blade/blade-swagger:${TAG}"
|
image: "${REGISTER}/blade-swagger:${TAG}"
|
||||||
ports:
|
ports:
|
||||||
- 18000:18000
|
- 18000:18000
|
||||||
privileged: true
|
privileged: true
|
||||||
@ -81,7 +83,7 @@ services:
|
|||||||
- blade_net
|
- blade_net
|
||||||
|
|
||||||
blade-gateway1:
|
blade-gateway1:
|
||||||
image: "${REGISTER}/blade/blade-gateway:${TAG}"
|
image: "${REGISTER}/blade-gateway:${TAG}"
|
||||||
privileged: true
|
privileged: true
|
||||||
restart: always
|
restart: always
|
||||||
networks:
|
networks:
|
||||||
@ -89,7 +91,7 @@ services:
|
|||||||
ipv4_address: 172.30.0.81
|
ipv4_address: 172.30.0.81
|
||||||
|
|
||||||
blade-gateway2:
|
blade-gateway2:
|
||||||
image: "${REGISTER}/blade/blade-gateway:${TAG}"
|
image: "${REGISTER}/blade-gateway:${TAG}"
|
||||||
privileged: true
|
privileged: true
|
||||||
restart: always
|
restart: always
|
||||||
networks:
|
networks:
|
||||||
@ -97,7 +99,7 @@ services:
|
|||||||
ipv4_address: 172.30.0.82
|
ipv4_address: 172.30.0.82
|
||||||
|
|
||||||
blade-auth1:
|
blade-auth1:
|
||||||
image: "${REGISTER}/blade/blade-auth:${TAG}"
|
image: "${REGISTER}/blade-auth:${TAG}"
|
||||||
privileged: true
|
privileged: true
|
||||||
restart: always
|
restart: always
|
||||||
networks:
|
networks:
|
||||||
@ -105,7 +107,7 @@ services:
|
|||||||
ipv4_address: 172.30.0.91
|
ipv4_address: 172.30.0.91
|
||||||
|
|
||||||
blade-auth2:
|
blade-auth2:
|
||||||
image: "${REGISTER}/blade/blade-auth:${TAG}"
|
image: "${REGISTER}/blade-auth:${TAG}"
|
||||||
privileged: true
|
privileged: true
|
||||||
restart: always
|
restart: always
|
||||||
networks:
|
networks:
|
||||||
@ -113,7 +115,7 @@ services:
|
|||||||
ipv4_address: 172.30.0.92
|
ipv4_address: 172.30.0.92
|
||||||
|
|
||||||
blade-report:
|
blade-report:
|
||||||
image: "${REGISTER}/blade/blade-report:${TAG}"
|
image: "${REGISTER}/blade-report:${TAG}"
|
||||||
privileged: true
|
privileged: true
|
||||||
restart: always
|
restart: always
|
||||||
networks:
|
networks:
|
||||||
@ -121,35 +123,35 @@ services:
|
|||||||
ipv4_address: 172.30.0.98
|
ipv4_address: 172.30.0.98
|
||||||
|
|
||||||
blade-log:
|
blade-log:
|
||||||
image: "${REGISTER}/blade/blade-log:${TAG}"
|
image: "${REGISTER}/blade-log:${TAG}"
|
||||||
privileged: true
|
privileged: true
|
||||||
restart: always
|
restart: always
|
||||||
networks:
|
networks:
|
||||||
- blade_net
|
- blade_net
|
||||||
|
|
||||||
blade-desk:
|
blade-desk:
|
||||||
image: "${REGISTER}/blade/blade-desk:${TAG}"
|
image: "${REGISTER}/blade-desk:${TAG}"
|
||||||
privileged: true
|
privileged: true
|
||||||
restart: always
|
restart: always
|
||||||
networks:
|
networks:
|
||||||
- blade_net
|
- blade_net
|
||||||
|
|
||||||
blade-user:
|
blade-user:
|
||||||
image: "${REGISTER}/blade/blade-user:${TAG}"
|
image: "${REGISTER}/blade-user:${TAG}"
|
||||||
privileged: true
|
privileged: true
|
||||||
restart: always
|
restart: always
|
||||||
networks:
|
networks:
|
||||||
- blade_net
|
- blade_net
|
||||||
|
|
||||||
blade-system:
|
blade-system:
|
||||||
image: "${REGISTER}/blade/blade-system:${TAG}"
|
image: "${REGISTER}/blade-system:${TAG}"
|
||||||
privileged: true
|
privileged: true
|
||||||
restart: always
|
restart: always
|
||||||
networks:
|
networks:
|
||||||
- blade_net
|
- blade_net
|
||||||
|
|
||||||
blade-resource:
|
blade-resource:
|
||||||
image: "${REGISTER}/blade/blade-resource:${TAG}"
|
image: "${REGISTER}/blade-resource:${TAG}"
|
||||||
privileged: true
|
privileged: true
|
||||||
restart: always
|
restart: always
|
||||||
networks:
|
networks:
|
||||||
|
Loading…
Reference in New Issue
Block a user