暂存提交

This commit is contained in:
2026-08-01 12:02:01 +08:00
parent cad6c37af4
commit 15b7e68346
9 changed files with 29 additions and 20 deletions
+3 -1
View File
@@ -26,7 +26,9 @@ spring:
register-enabled: ${NACOS_REGISTER_ENABLED:true}
group: ${NACOS_GROUP:BAIYUE}
namespace: ${NACOS_NAMESPACE:public}
config.namespace: ${NACOS_NAMESPACE:public}
config:
namespace: ${NACOS_NAMESPACE:public}
encode: UTF-8
baiyue.security:
jwt-secret: ${JWT_SECRET:change-me-to-at-least-32-bytes-long-before-start}
internal-service-token: ${INTERNAL_SERVICE_TOKEN:change-me-to-an-internal-token-at-least-32-bytes-long}
+3 -13
View File
@@ -1,4 +1,3 @@
# 头程本地公共配置。生产环境不得直接使用本文件中的本地默认密钥。
baiyue:
deployment:
region-code: ${REGION_CODE:CN}
@@ -32,6 +31,9 @@ spring:
client.config.default:
connect-timeout: 3000
read-timeout: 5000
logging:
file:
path: ${LOG_PATH:./logs}
server.shutdown: graceful
management:
endpoints.web.exposure.include: health,info,prometheus
@@ -42,7 +44,6 @@ mybatis-plus:
configuration:
map-underscore-to-camel-case: true
call-setters-on-nulls: true
log-impl: org.apache.ibatis.logging.slf4j.Slf4jImpl
global-config:
banner: false
db-config:
@@ -50,17 +51,6 @@ mybatis-plus:
logic-delete-field: deleted
logic-delete-value: 1
logic-not-delete-value: 0
logging:
level:
com.baiyue.auth.mapper: ${MYBATIS_SQL_LOG_LEVEL:DEBUG}
com.baiyue.iam.mapper: ${MYBATIS_SQL_LOG_LEVEL:DEBUG}
com.baiyue.order.mapper: ${MYBATIS_SQL_LOG_LEVEL:DEBUG}
com.baiyue.firstleg.mapper: ${MYBATIS_SQL_LOG_LEVEL:DEBUG}
com.baiyue.warehouse.mapper: ${MYBATIS_SQL_LOG_LEVEL:DEBUG}
com.baiyue.file.mapper: ${MYBATIS_SQL_LOG_LEVEL:DEBUG}
com.baiyue.print.mapper: ${MYBATIS_SQL_LOG_LEVEL:DEBUG}
com.baiyue.audit.mapper: ${MYBATIS_SQL_LOG_LEVEL:DEBUG}
com.baiyue.eventbridge.mapper: ${MYBATIS_SQL_LOG_LEVEL:DEBUG}
springdoc:
api-docs.enabled: ${SWAGGER_ENABLED:true}
swagger-ui.enabled: ${SWAGGER_ENABLED:true}
+8
View File
@@ -1,3 +1,11 @@
springdoc:
api-docs.enabled: ${SWAGGER_ENABLED:true}
swagger-ui.enabled: ${SWAGGER_ENABLED:true}
baiyue:
cors:
allowed-origins: ${CORS_ALLOWED_ORIGINS:http://localhost:5173,http://localhost:5174,http://127.0.0.1:5173,http://127.0.0.1:5174}
allowed-methods: ${CORS_ALLOWED_METHODS:GET,POST,PUT,PATCH,DELETE,OPTIONS}
allowed-headers: ${CORS_ALLOWED_HEADERS:*}
exposed-headers: ${CORS_EXPOSED_HEADERS:X-Request-Id,X-Trace-Id}
allow-credentials: ${CORS_ALLOW_CREDENTIALS:true}
max-age: ${CORS_MAX_AGE:3600}
-1
View File
@@ -4,5 +4,4 @@ spring.datasource:
username: ${ORDER_DB_USERNAME:root}
password: ${ORDER_DB_PASSWORD:123456}
baiyue.clients:
# 默认留空并使用 Nacos 的 warehouse-service 实例;仅独立端口回归时显式设置直连 URL。
warehouse.url: ${WAREHOUSE_SERVICE_URL:}
+1
View File
@@ -21,6 +21,7 @@ spring:
namespace: ${NACOS_NAMESPACE:public}
config:
namespace: ${NACOS_NAMESPACE:public}
encode: UTF-8
baiyue:
clients:
auth:
+3 -1
View File
@@ -19,7 +19,9 @@ spring:
register-enabled: ${NACOS_REGISTER_ENABLED:true}
group: ${NACOS_GROUP:BAIYUE}
namespace: ${NACOS_NAMESPACE:public}
config.namespace: ${NACOS_NAMESPACE:public}
config:
namespace: ${NACOS_NAMESPACE:public}
encode: UTF-8
management.endpoints.web.exposure.include: health,info,prometheus
baiyue:
+1
View File
@@ -1,6 +1,7 @@
$env:NACOS_SERVER_ADDR = '127.0.0.1:8848'
$env:NACOS_NAMESPACE = 'public'
$env:NACOS_GROUP = 'BAIYUE'
$env:SPRING_CLOUD_NACOS_CONFIG_ENCODE = 'UTF-8'
$env:REDIS_HOST = '127.0.0.1'
$env:REDIS_PORT = '6379'
$env:SPRING_DATA_REDIS_HOST = '127.0.0.1'
+7 -3
View File
@@ -12,7 +12,7 @@ $publishUrl = "http://$ServerAddr/nacos/v1/cs/configs"
$health = Invoke-WebRequest -UseBasicParsing -Uri $healthUrl -TimeoutSec 5
if ($health.StatusCode -ne 200 -or $health.Content.Trim() -ne 'OK') {
throw "Local Nacos is not ready: $healthUrl"
throw "Nacos not ready: $healthUrl"
}
$files = Get-ChildItem -LiteralPath $configRoot -File -Filter '*.yml' | Sort-Object Name
@@ -32,9 +32,13 @@ foreach ($file in $files) {
$body.tenant = $Namespace
}
$pairs = foreach ($entry in $body.GetEnumerator()) {
[uri]::EscapeDataString([string]$entry.Key) + '=' + [uri]::EscapeDataString([string]$entry.Value)
}
$form = $pairs -join '&'
$result = Invoke-RestMethod -Method Post -Uri $publishUrl `
-ContentType 'application/x-www-form-urlencoded; charset=UTF-8' `
-Body $body -TimeoutSec 10
-Body $form -TimeoutSec 10
if ([string]$result -ne 'true') {
throw "Publish failed: $($file.Name), Nacos response: $result"
}
@@ -42,4 +46,4 @@ foreach ($file in $files) {
Write-Host "Published $($file.Name) -> $Namespace / $Group"
}
Write-Host "Local first-leg Nacos configuration published: $published items."
Write-Host "Published local Nacos configuration: $published items."
+3 -1
View File
@@ -19,7 +19,9 @@ spring:
register-enabled: ${NACOS_REGISTER_ENABLED:true}
group: ${NACOS_GROUP:BAIYUE}
namespace: ${NACOS_NAMESPACE:public}
config.namespace: ${NACOS_NAMESPACE:public}
config:
namespace: ${NACOS_NAMESPACE:public}
encode: UTF-8
baiyue:
security:
jwt-secret: ${JWT_SECRET:change-me-to-at-least-32-bytes-long-before-start}