Commit 0737f607 authored by zhang 张号彬's avatar zhang 张号彬

修改NacosConfigListener

parent 6db69bca
package com.elitesland; package com.elitesland;
import com.elitesland.router.config.NacosConfigListener;
import com.elitesland.router.service.DynamicRouteService;
import com.elitesland.router.util.GateWayNacosUtils;
import org.springframework.beans.factory.annotation.Autowired;
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.autoconfigure.jdbc.DataSourceAutoConfiguration; import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.annotation.Bean;
/** /**
* <p> * <p>
......
...@@ -21,5 +21,4 @@ public class GatewayRouteDefinition{ ...@@ -21,5 +21,4 @@ public class GatewayRouteDefinition{
private String uri; private String uri;
//路由执行的顺序 //路由执行的顺序
private int order = 0; private int order = 0;
//此处省略get和set方法
} }
\ No newline at end of file
...@@ -18,11 +18,8 @@ import org.springframework.cloud.gateway.route.RouteDefinition; ...@@ -18,11 +18,8 @@ import org.springframework.cloud.gateway.route.RouteDefinition;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.web.util.UriComponentsBuilder; import org.springframework.web.util.UriComponentsBuilder;
import reactor.core.publisher.Flux; import reactor.core.publisher.Flux;
import java.net.URI; import java.net.URI;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.Executor; import java.util.concurrent.Executor;
/* /*
...@@ -39,13 +36,9 @@ public class NacosConfigListener implements CommandLineRunner { ...@@ -39,13 +36,9 @@ public class NacosConfigListener implements CommandLineRunner {
private DynamicRouteService dynamicRouteService; private DynamicRouteService dynamicRouteService;
@Autowired @Autowired
private InMemoryRouteDefinitionRepository inMemoryRouteDefinitionRepository; private InMemoryRouteDefinitionRepository inMemoryRouteDefinitionRepository;
//由于可能根据需要在定时任务中引用该list,因此使用线程安全的SynchronizedListlist
public static List<GatewayRouteDefinition> list = Collections.synchronizedList(new ArrayList<>());
@Override @Override
public void run(String... args) { public void run(String... args) {
getConfig(); getConfig();
} }
private void getConfig() { private void getConfig() {
...@@ -54,14 +47,13 @@ public class NacosConfigListener implements CommandLineRunner { ...@@ -54,14 +47,13 @@ public class NacosConfigListener implements CommandLineRunner {
ConfigService configService = gateWayNacosUtils.getNacosConfigService(); ConfigService configService = gateWayNacosUtils.getNacosConfigService();
Gson gson = new Gson(); Gson gson = new Gson();
//注册nacos配置监听,当nacos配置信息发生改变时刷新本地内存中Gateway Route规则信息 //注册nacos配置监听,当nacos配置信息发生改变时刷新本地内存中Gateway Route规则信息
refreshLocalRoute(routeDefinitions, gson,true); refreshLocalRoute(routeDefinitions, gson, true);
String group = gateWayNacosUtils.getNacosConfigGroup(); String group = gateWayNacosUtils.getNacosConfigGroup();
String routeConfigDataId = gateWayNacosUtils.getNacosConfigDataIdForGateWayDefinition(); String routeConfigDataId = gateWayNacosUtils.getNacosConfigDataIdForGateWayDefinition();
configService.addListener(routeConfigDataId, group, new Listener() { configService.addListener(routeConfigDataId, group, new Listener() {
@Override @Override
public void receiveConfigInfo(String configInfo) { public void receiveConfigInfo(String configInfo) {
System.out.println(configInfo+"------->"); refreshLocalRoute(configInfo, gson, false);
refreshLocalRoute(configInfo, gson,false);
} }
@Override @Override
public Executor getExecutor() { public Executor getExecutor() {
...@@ -73,24 +65,22 @@ public class NacosConfigListener implements CommandLineRunner { ...@@ -73,24 +65,22 @@ public class NacosConfigListener implements CommandLineRunner {
e.printStackTrace(); e.printStackTrace();
} }
} }
/** /**
* 根据nacos配置信息,刷新本地Gateway RouteDefinition * 根据nacos配置信息,刷新本地Gateway RouteDefinition
*/ */
private void refreshLocalRoute(String initConfigInfo, Gson gson, boolean t) { private void refreshLocalRoute(String initConfigInfo, Gson gson, boolean t) {
//删除内存中已存在的动态路由配置信息 //删除内存中已存在的动态路由配置信息
if(list.size() > 0){ Flux<RouteDefinition> routeDefinitions = inMemoryRouteDefinitionRepository.getRouteDefinitions();
list.forEach(gatewayRouteDefinition -> { //由于不存在空指针情况,因此无需空指针判断
dynamicRouteService.delete(gatewayRouteDefinition.getId()); routeDefinitions.subscribe(routeDefinition -> {
}); dynamicRouteService.delete(routeDefinition.getId());
list = Collections.synchronizedList(new ArrayList<>()); });
}
JsonArray jsonArray = gson.fromJson(initConfigInfo, JsonArray.class); JsonArray jsonArray = gson.fromJson(initConfigInfo, JsonArray.class);
jsonArray.forEach(routeDefinitionAsJsonObject -> { jsonArray.forEach(routeDefinitionAsJsonObject -> {
GatewayRouteDefinition gatewayRouteDefinition = gson.fromJson(routeDefinitionAsJsonObject, GatewayRouteDefinition.class); GatewayRouteDefinition gatewayRouteDefinition = gson.fromJson(routeDefinitionAsJsonObject, GatewayRouteDefinition.class);
RouteDefinition definition = convertRouteDefinition(gatewayRouteDefinition); RouteDefinition definition = convertRouteDefinition(gatewayRouteDefinition);
dynamicRouteService.add(definition); dynamicRouteService.add(definition);
list.add(gatewayRouteDefinition);
}); });
} }
...@@ -101,7 +91,6 @@ public class NacosConfigListener implements CommandLineRunner { ...@@ -101,7 +91,6 @@ public class NacosConfigListener implements CommandLineRunner {
RouteDefinition definition = new RouteDefinition(); RouteDefinition definition = new RouteDefinition();
definition.setId(gwdefinition.getId()); definition.setId(gwdefinition.getId());
definition.setOrder(gwdefinition.getOrder()); definition.setOrder(gwdefinition.getOrder());
//设置断言 //设置断言
ArrayList<PredicateDefinition> pdList = new ArrayList<>(); ArrayList<PredicateDefinition> pdList = new ArrayList<>();
ArrayList<GatewayPredicateDefinition> gatewayPredicateDefinitionList = gwdefinition.getPredicates(); ArrayList<GatewayPredicateDefinition> gatewayPredicateDefinitionList = gwdefinition.getPredicates();
...@@ -112,7 +101,6 @@ public class NacosConfigListener implements CommandLineRunner { ...@@ -112,7 +101,6 @@ public class NacosConfigListener implements CommandLineRunner {
pdList.add(predicate); pdList.add(predicate);
}); });
definition.setPredicates(pdList); definition.setPredicates(pdList);
//设置过滤器 //设置过滤器
ArrayList<FilterDefinition> filters = new ArrayList(); ArrayList<FilterDefinition> filters = new ArrayList();
ArrayList<GatewayFilterDefinition> gatewayFilters = gwdefinition.getFilters(); ArrayList<GatewayFilterDefinition> gatewayFilters = gwdefinition.getFilters();
...@@ -123,7 +111,6 @@ public class NacosConfigListener implements CommandLineRunner { ...@@ -123,7 +111,6 @@ public class NacosConfigListener implements CommandLineRunner {
filters.add(filter); filters.add(filter);
}); });
definition.setFilters(filters); definition.setFilters(filters);
URI uri = null; URI uri = null;
if (gwdefinition.getUri().startsWith("http")) { if (gwdefinition.getUri().startsWith("http")) {
uri = UriComponentsBuilder.fromHttpUrl(gwdefinition.getUri()).build().toUri(); uri = UriComponentsBuilder.fromHttpUrl(gwdefinition.getUri()).build().toUri();
......
package com.elitesland.router.controller; package com.elitesland.router.controller;
import com.elitesland.router.bean.GatewayRouteDefinition; import com.elitesland.router.bean.GatewayRouteDefinition;
import com.elitesland.router.service.DynamicRouteService; import com.elitesland.router.service.DynamicRouteService;
import com.elitesland.router.service.GatewayRoutesInNacosConfigService; import com.elitesland.router.service.GatewayRoutesInNacosConfigService;
...@@ -8,12 +7,16 @@ import com.google.gson.Gson; ...@@ -8,12 +7,16 @@ import com.google.gson.Gson;
import com.google.gson.JsonArray; import com.google.gson.JsonArray;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.gateway.config.PropertiesRouteDefinitionLocator; import org.springframework.cloud.gateway.config.PropertiesRouteDefinitionLocator;
import org.springframework.cloud.gateway.route.InMemoryRouteDefinitionRepository; import org.springframework.cloud.gateway.route.*;
import org.springframework.cloud.gateway.route.Route;
import org.springframework.cloud.gateway.route.RouteDefinition;
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder; import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
import org.springframework.cloud.gateway.support.ServerWebExchangeUtils;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.springframework.web.server.ServerWebExchange;
import org.springframework.web.server.ServerWebExchangeDecorator;
import reactor.core.publisher.Flux; import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
import java.util.ArrayList; import java.util.ArrayList;
/* /*
...@@ -21,8 +24,8 @@ import java.util.ArrayList; ...@@ -21,8 +24,8 @@ import java.util.ArrayList;
*@Date 2021-02-10 19:17 *@Date 2021-02-10 19:17
*@Description *@Description
* http://localhost:9040/actuator/gateway/routes 通过acutator查询route配置信息 * http://localhost:9040/actuator/gateway/routes 通过acutator查询route配置信息
* 在生产环境中配置信息将通过redis进行查询及持久化操作
*/ */
@RestController @RestController
@RequestMapping("/route") @RequestMapping("/route")
public class RouteController { public class RouteController {
...@@ -31,31 +34,27 @@ public class RouteController { ...@@ -31,31 +34,27 @@ public class RouteController {
@Autowired @Autowired
PropertiesRouteDefinitionLocator PropertiesRouteDefinitionLocator; PropertiesRouteDefinitionLocator PropertiesRouteDefinitionLocator;
@Autowired
private DynamicRouteService dynamicRouteService;
/** /**
*增加路由 *增加路由
*/ */
@PostMapping("/addOrUpdate") @PostMapping("/addOrUpdate")
public GatewayRouteDefinition addOrUpdate(@RequestBody GatewayRouteDefinition gwdefinition) { public Mono<GatewayRouteDefinition> addOrUpdate(@RequestBody GatewayRouteDefinition gwdefinition) {
return gatewayRoutesInNacosConfigService.addOrUpdateRouteDefinitiToNacosServer(gwdefinition); return Mono.just(gatewayRoutesInNacosConfigService.addOrUpdateRouteDefinitiToNacosServer(gwdefinition));
} }
/** /**
*删除路由 *删除路由
*/ */
@DeleteMapping("/routes/{id}") @DeleteMapping("/routes/{id}")
public String delete(@PathVariable String id) { public Mono<String> delete(@PathVariable String id) {
return gatewayRoutesInNacosConfigService.deleteRouteDefinitiToNacosServer(id); return Mono.just(gatewayRoutesInNacosConfigService.deleteRouteDefinitiToNacosServer(id));
} }
/** /**
* 获取nacos里配置的动态路由配置信息 * 获取nacos里配置的动态路由配置信息
* */ */
@GetMapping("/routes/all") @GetMapping("/routes/all")
public Flux<ArrayList<GatewayRouteDefinition>> all() { public Flux<GatewayRouteDefinition> routes() {
Gson g = new Gson(); Gson g = new Gson();
ArrayList<GatewayRouteDefinition> list = new ArrayList<>(); ArrayList<GatewayRouteDefinition> list = new ArrayList<>();
JsonArray gatewayDefinitionsFromNacosServer = gatewayRoutesInNacosConfigService.getGatewayDefinitionsFromNacosServer(); JsonArray gatewayDefinitionsFromNacosServer = gatewayRoutesInNacosConfigService.getGatewayDefinitionsFromNacosServer();
...@@ -63,15 +62,14 @@ public class RouteController { ...@@ -63,15 +62,14 @@ public class RouteController {
GatewayRouteDefinition gatewayRouteDefinition = g.fromJson(o, GatewayRouteDefinition.class); GatewayRouteDefinition gatewayRouteDefinition = g.fromJson(o, GatewayRouteDefinition.class);
list.add(gatewayRouteDefinition); list.add(gatewayRouteDefinition);
}); });
return Flux.just(list); return Flux.fromIterable(list);
} }
/** /**
* 获取本地所有的动态路由配置信息 * 获取本地所配置文件中所有的静态路由配置信息
* */ */
@GetMapping("/all") @GetMapping("staticRoutes/all")
public Flux<RouteDefinition> all1() { public Flux<RouteDefinition> staticRoutes() {
Flux<RouteDefinition> routeDefinitions = PropertiesRouteDefinitionLocator.getRouteDefinitions(); return PropertiesRouteDefinitionLocator.getRouteDefinitions();
routeDefinitions.subscribe();
return routeDefinitions;
} }
} }
\ No newline at end of file
package com.elitesland.router.service; package com.elitesland.router.service;
import com.elitesland.router.util.GateWayNacosUtils; import com.elitesland.router.util.GateWayNacosUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.gateway.config.GatewayProperties;
import org.springframework.cloud.gateway.config.PropertiesRouteDefinitionLocator;
import org.springframework.cloud.gateway.event.RefreshRoutesEvent; import org.springframework.cloud.gateway.event.RefreshRoutesEvent;
import org.springframework.cloud.gateway.route.RouteDefinition; import org.springframework.cloud.gateway.route.RouteDefinition;
import org.springframework.cloud.gateway.route.RouteDefinitionRepository;
import org.springframework.cloud.gateway.route.RouteDefinitionWriter; import org.springframework.cloud.gateway.route.RouteDefinitionWriter;
import org.springframework.cloud.gateway.support.NotFoundException; import org.springframework.cloud.gateway.support.NotFoundException;
import org.springframework.context.ApplicationEventPublisher; import org.springframework.context.ApplicationEventPublisher;
...@@ -14,7 +16,6 @@ import org.springframework.stereotype.Service; ...@@ -14,7 +16,6 @@ import org.springframework.stereotype.Service;
import reactor.core.publisher.Mono; import reactor.core.publisher.Mono;
import java.util.ArrayList; import java.util.ArrayList;
/* /*
*@Author Horbin.Zhang *@Author Horbin.Zhang
*@Date 2021-02-10 19:29 *@Date 2021-02-10 19:29
...@@ -30,10 +31,12 @@ public class DynamicRouteService implements ApplicationEventPublisherAware { ...@@ -30,10 +31,12 @@ public class DynamicRouteService implements ApplicationEventPublisherAware {
@Autowired @Autowired
private RouteDefinitionWriter routeDefinitionWriter; private RouteDefinitionWriter routeDefinitionWriter;
private ApplicationEventPublisher publisher; @Autowired
GatewayProperties gatewayProperties;
private ApplicationEventPublisher publisher;
private ArrayList<String> routeIdInMemory = new ArrayList<>(); private ArrayList<String> routeIdInMemory = new ArrayList<>();
@Override @Override
public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) { public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) {
...@@ -46,7 +49,7 @@ public class DynamicRouteService implements ApplicationEventPublisherAware { ...@@ -46,7 +49,7 @@ public class DynamicRouteService implements ApplicationEventPublisherAware {
public String add(RouteDefinition definition) { public String add(RouteDefinition definition) {
routeDefinitionWriter.save(Mono.just(definition)).subscribe(); routeDefinitionWriter.save(Mono.just(definition)).subscribe();
this.publisher.publishEvent(new RefreshRoutesEvent(this)); this.publisher.publishEvent(new RefreshRoutesEvent(this));
return "删除成功!"; return "添加成功!";
} }
/** /**
......
...@@ -6,20 +6,10 @@ import com.elitesland.router.util.GateWayNacosUtils; ...@@ -6,20 +6,10 @@ import com.elitesland.router.util.GateWayNacosUtils;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.google.gson.JsonArray; import com.google.gson.JsonArray;
import com.google.gson.JsonElement; import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.gateway.config.PropertiesRouteDefinitionLocator;
import org.springframework.cloud.gateway.event.RefreshRoutesEvent;
import org.springframework.cloud.gateway.route.CachingRouteDefinitionLocator;
import org.springframework.cloud.gateway.route.InMemoryRouteDefinitionRepository;
import org.springframework.cloud.gateway.route.RouteDefinition;
import org.springframework.cloud.gateway.route.RouteDefinitionRepository;
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder; import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import reactor.core.Disposable;
import reactor.core.publisher.Flux;
import java.util.List;
/* /*
*@Author Horbin.Zhang *@Author Horbin.Zhang
...@@ -28,10 +18,13 @@ import java.util.List; ...@@ -28,10 +18,13 @@ import java.util.List;
*/ */
@Service @Service
public class GatewayRoutesInNacosConfigService { public class GatewayRoutesInNacosConfigService {
@Autowired @Autowired
private GateWayNacosUtils gateWayNacosUtils; private GateWayNacosUtils gateWayNacosUtils;
@Autowired @Autowired
org.springframework.cloud.gateway.config.PropertiesRouteDefinitionLocator propertiesRouteDefinitionLocator; org.springframework.cloud.gateway.config.PropertiesRouteDefinitionLocator propertiesRouteDefinitionLocator;
@Autowired @Autowired
private DynamicRouteService dynamicRouteService; private DynamicRouteService dynamicRouteService;
...@@ -40,16 +33,6 @@ public class GatewayRoutesInNacosConfigService { ...@@ -40,16 +33,6 @@ public class GatewayRoutesInNacosConfigService {
public GatewayRouteDefinition addOrUpdateRouteDefinitiToNacosServer(GatewayRouteDefinition gwdefinition) { public GatewayRouteDefinition addOrUpdateRouteDefinitiToNacosServer(GatewayRouteDefinition gwdefinition) {
try { try {
//清除静态配置路由信息中存在的动态路由信息
// Flux<RouteDefinition> routeDefinitions = propertiesRouteDefinitionLocator.getRouteDefinitions();
// routeDefinitions.subscribe( routeDefinition ->{
// if (routeDefinition.getId().equalsIgnoreCase(gwdefinition.getId())) {
// System.out.println(routeDefinition.getId()+"++++++++++++++++++++++++++++++++++++++++++========");
// dynamicRouteService.delete(routeDefinition.getId());
// }
// });
Gson gson = new Gson(); Gson gson = new Gson();
String gateWayDefinitions = gateWayNacosUtils.getRouteDefinitionsFromNacosServer(); String gateWayDefinitions = gateWayNacosUtils.getRouteDefinitionsFromNacosServer();
boolean flag = false; boolean flag = false;
...@@ -68,7 +51,6 @@ public class GatewayRoutesInNacosConfigService { ...@@ -68,7 +51,6 @@ public class GatewayRoutesInNacosConfigService {
} }
JsonElement jsonElement = gson.toJsonTree(gwdefinition, GatewayRouteDefinition.class); JsonElement jsonElement = gson.toJsonTree(gwdefinition, GatewayRouteDefinition.class);
newConfig.add(jsonElement); newConfig.add(jsonElement);
ConfigService configService = gateWayNacosUtils.getNacosConfigService(); ConfigService configService = gateWayNacosUtils.getNacosConfigService();
String group = gateWayNacosUtils.getNacosConfigGroup(); String group = gateWayNacosUtils.getNacosConfigGroup();
String routeConfigDataId = gateWayNacosUtils.getNacosConfigDataIdForGateWayDefinition(); String routeConfigDataId = gateWayNacosUtils.getNacosConfigDataIdForGateWayDefinition();
......
package com.elitesland.router.util; package com.elitesland.router.util;
import com.alibaba.nacos.api.NacosFactory; import com.alibaba.nacos.api.NacosFactory;
import com.alibaba.nacos.api.config.ConfigService; import com.alibaba.nacos.api.config.ConfigService;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
...@@ -31,17 +30,19 @@ public class GateWayNacosUtils { ...@@ -31,17 +30,19 @@ public class GateWayNacosUtils {
String initConfigInfo = configService.getConfig(routeConfigDataId, group, 5000); String initConfigInfo = configService.getConfig(routeConfigDataId, group, 5000);
return initConfigInfo; return initConfigInfo;
} }
public ConfigService getNacosConfigService() throws Exception{ public ConfigService getNacosConfigService() throws Exception{
Properties properties = new Properties(); Properties properties = new Properties();
properties.put("serverAddr", serverAddr); properties.put("serverAddr", serverAddr);
ConfigService configService = NacosFactory.createConfigService(properties); ConfigService configService = NacosFactory.createConfigService(properties);
return configService; return configService;
} }
public String getNacosConfigGroup(){ public String getNacosConfigGroup(){
return this.group; return this.group;
} }
public String getNacosConfigDataIdForGateWayDefinition(){ public String getNacosConfigDataIdForGateWayDefinition(){
return this.routeConfigDataId; return this.routeConfigDataId;
} }
} }
...@@ -75,24 +75,16 @@ spring: ...@@ -75,24 +75,16 @@ spring:
# - Header=orgCode,zz00001 # - Header=orgCode,zz00001
# filters: # filters:
# - RewritePath=/mdxt/(?<segment>.*),/$\{segment} # - RewritePath=/mdxt/(?<segment>.*),/$\{segment}
nacos: nacos:
discovery: discovery:
server-addr: frps.elitescloud.com:25145 server-addr: frps.elitescloud.com:25145
# enabled: true # enabled: true
# register-enabled: true # register-enabled: true
gateway: gateway:
nacos: nacos:
routeinfo: routeinfo:
dataid: gateway.routeinfo.json dataid: gateway.routeinfo.json
group: DEFAULT_GROUP group: DEFAULT_GROUP
# 内部端点暴露 # 内部端点暴露
management: management:
endpoints: endpoints:
...@@ -102,17 +94,12 @@ management: ...@@ -102,17 +94,12 @@ management:
endpoint: endpoint:
health: health:
show-details: always show-details: always
# datasource: # datasource:
# url: jdbc:mysql://frps.elitescloud.com:25148/jyj_fc?rewriteBatchedStatements=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&useSSL=false&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true # url: jdbc:mysql://frps.elitescloud.com:25148/jyj_fc?rewriteBatchedStatements=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&useSSL=false&allowPublicKeyRetrieval=true&nullCatalogMeansCurrent=true
# username: root # username: root
# password: 123456 # password: 123456
# tomcat: # tomcat:
# ignore-exception-on-pre-load: # ignore-exception-on-pre-load:
jwt: jwt:
header: Authorization header: Authorization
# 令牌前缀 # 令牌前缀
......
...@@ -3,9 +3,5 @@ spring: ...@@ -3,9 +3,5 @@ spring:
#active: ${profileActive} #active: ${profileActive}
application: application:
name: yst-gateway name: yst-gateway
server: server:
port: 9040 port: 9040
# servlet: \ No newline at end of file
# context-path: ""
spring: spring:
cloud: cloud:
nacos: nacos:
config: config:
server-addr: frps.elitescloud.com:25145 server-addr: frps.elitescloud.com:25145
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment