Compare commits

..

1 Commits

Author SHA1 Message Date
sxu 84677df1c9 bootstrap-jyy_canteen_local 2025-04-03 14:23:00 +08:00
9 changed files with 121 additions and 37 deletions

View File

@ -0,0 +1,27 @@
# Tomcat
server:
port: 58081
# Spring
spring:
cloud:
nacos:
discovery:
# 服务注册地址
server-addr: 127.0.0.1:8848
namespace: jyy_canteen
config:
# 配置中心地址
server-addr: 127.0.0.1:8848
namespace: jyy_canteen
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
#加密组件
jasypt:
encryptor:
password: Encrypt

View File

@ -5,7 +5,7 @@ spring:
name: bonus-auth
profiles:
# 环境配置
active: smart_canteen_local
active: dev
#加密组件
jasypt:

View File

@ -1,33 +0,0 @@
package com.bonus.gateway.config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.reactive.CorsWebFilter;
import org.springframework.web.cors.reactive.UrlBasedCorsConfigurationSource;
import org.springframework.web.util.pattern.PathPatternParser;
/**
* Description 全局跨域配置
*/
@Configuration
public class GlobalCorsConfig {
@Bean
public CorsWebFilter corsFilter() {
// 创建一个新的CorsConfiguration对象用于配置跨域请求
CorsConfiguration config = new CorsConfiguration();
// 允许所有的HTTP请求方法GET, POST, PUT, DELETE等
config.addAllowedMethod("*");
// 允许所有的域名发起的请求 比如http://localhost:8080
config.addAllowedOrigin("*");
// 允许所有的域名发起的请求支持正则表达式 比如http://localhost:8080
config.addAllowedOriginPattern("*");
// 允许所有的请求头部信息 比如tokenContent-Type
config.addAllowedHeader("*");
// 创建一个UrlBasedCorsConfigurationSource对象并使用PathPatternParser进行路径匹配
UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(new PathPatternParser());
// 注册跨域配置应用于所有的URL路径
source.registerCorsConfiguration("/**", config);
return new CorsWebFilter(source);
}
}

View File

@ -0,0 +1,43 @@
# Tomcat
server:
port: 58080
# Spring
spring:
cloud:
nacos:
discovery:
# 服务注册地址
server-addr: 127.0.0.1:8848
namespace: jyy_canteen
config:
# 配置中心地址
server-addr: 127.0.0.1:8848
namespace: jyy_canteen
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
sentinel:
# 取消控制台懒加载
eager: true
transport:
# 控制台地址
dashboard: 127.0.0.1:18858
# nacos配置持久化
datasource:
ds1:
nacos:
server-addr: 127.0.0.1:8848
namespace: sgzb_bns
dataId: sentinel-bonus-gateway
groupId: DEFAULT_GROUP
data-type: json
rule-type: gw-flow
#加密组件
jasypt:
encryptor:
password: Encrypt

View File

@ -5,7 +5,7 @@ spring:
name: bonus-gateway
profiles:
# 环境配置
active: smart_canteen_local
active: dev
#加密组件
jasypt:

View File

@ -0,0 +1,21 @@
# Tomcat
server:
port: 59300
# Spring
spring:
cloud:
nacos:
discovery:
# 服务注册地址
server-addr: 127.0.0.1:8848
namespace: jyy_canteen
config:
# 配置中心地址
server-addr: 127.0.0.1:8848
namespace: jyy_canteen
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}

View File

@ -6,7 +6,7 @@ spring:
profiles:
# 环境配置
active: smart_canteen_local
active: dev
#加密组件
jasypt:

View File

@ -0,0 +1,26 @@
# Tomcat
server:
port: 58082
# Spring
spring:
cloud:
nacos:
discovery:
# 服务注册地址
server-addr: 127.0.0.1:8848
namespace: jyy_canteen
config:
# 配置中心地址
server-addr: 127.0.0.1:8848
namespace: jyy_canteen
# 配置文件格式
file-extension: yml
# 共享配置
shared-configs:
- application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension}
#加密组件
jasypt:
encryptor:
password: Encrypt

View File

@ -5,7 +5,7 @@ spring:
name: bonus-system
profiles:
# 环境配置
active: smart_canteen_local
active: dev
task:
scheduling:
pool: