Skip to content

Commit 7cf5ef6

Browse files
committed
[Test 网关模块] 测试Debug Gateway服务上线 <Auto> -e:test -m:rvc-gateway -v:1.0 -rp:10010 -de:<-e ACTIVE=test -e UNIQUE_ID=0 -e SERVER_PORT=10010>
1 parent 9f33083 commit 7cf5ef6

File tree

3 files changed

+3
-11
lines changed

3 files changed

+3
-11
lines changed

rvc-gateway/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ ENV SERVER_PORT=${SERVER_PORT}
2020
ENV ACTIVE=${ACTIVE}
2121
ENV UNIQUE_ID=${UNIQUE_ID}
2222
EXPOSE ${SERVER_PORT}
23-
ENTRYPOINT ["java","-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:10015","-jar","/rvc-gateway.jar"]
23+
ENTRYPOINT ["java","-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:9400","-jar","/rvc-gateway.jar"]
2424

2525

2626

rvc-gateway/pom.xml

-3
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,6 @@
162162
<configuration>
163163
<executable>true</executable>
164164
<layout>JAR</layout>
165-
<jvmArguments>
166-
-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:10015
167-
</jvmArguments>
168165
</configuration>
169166
<executions>
170167
<execution>

rvc-gateway/src/main/java/com/tml/filter/AuthorizeFilter.java

+2-7
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,11 @@
33
import cn.dev33.satoken.exception.NotLoginException;
44
import cn.dev33.satoken.stp.StpUtil;
55
import com.alibaba.cloud.commons.lang.StringUtils;
6-
import com.alibaba.nacos.api.NacosFactory;
7-
import com.alibaba.nacos.api.config.ConfigService;
6+
87
import io.github.common.logger.CommonLogger;
98
import lombok.Data;
109
import lombok.SneakyThrows;
1110
import org.springframework.beans.factory.InitializingBean;
12-
import org.springframework.beans.factory.annotation.Value;
1311
import org.springframework.boot.context.properties.ConfigurationProperties;
1412
import org.springframework.cloud.context.config.annotation.RefreshScope;
1513
import org.springframework.cloud.gateway.filter.GatewayFilterChain;
@@ -21,15 +19,11 @@
2119
import org.springframework.http.server.reactive.ServerHttpResponse;
2220
import org.springframework.stereotype.Component;
2321
import org.springframework.web.server.ServerWebExchange;
24-
import org.yaml.snakeyaml.Yaml;
2522
import reactor.core.publisher.Mono;
2623

2724
import javax.annotation.Resource;
2825
import java.net.URL;
29-
import java.util.HashMap;
3026
import java.util.HashSet;
31-
import java.util.Map;
32-
import java.util.Properties;
3327

3428
import static com.tml.constant.GatewayConstantPool.AUTHORIZE_TOKEN;
3529

@@ -75,6 +69,7 @@ public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) {
7569
if(vars.length==2){
7670
String uid = vars[0];
7771
String username = vars[1];
72+
commonLogger.info("uid:%s,username:%s",uid,username);
7873
newRequest = request.mutate().header("uid",uid).header("username",username).build();
7974
return chain.filter(exchange.mutate().request(newRequest).build());
8075
}

0 commit comments

Comments
 (0)