Files
YschcmsService/src/main/resources/application.yml
T

130 lines
5.8 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
server:
port: 8072
servlet:
context-path: /cms
spring:
application:
name: cms
datasource:
url: jdbc:mysql://localhost:3306/bsch_cms?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Asia/Shanghai&allowPublicKeyRetrieval=true
username: root
password: 123456
driver-class-name: com.mysql.cj.jdbc.Driver
jpa:
hibernate:
ddl-auto: update
show-sql: false
open-in-view: false
properties:
hibernate:
jdbc:
time_zone: Asia/Shanghai
jackson:
# 管理端 JSON 时间格式(前端 DatePicker 对齐 yyyy-MM-dd HH:mm:ss)
date-format: yyyy-MM-dd HH:mm:ss
time-zone: Asia/Shanghai
# ===== 门户 SSR =====
thymeleaf:
cache: false # 本地改模板热生效;生产注入覆盖为 true(方案 §6.2)
prefix: classpath:/templates/
suffix: .html
encoding: UTF-8
servlet:
multipart:
max-file-size: 100MB
max-request-size: 100MB
# 1-2 校规模:Caffeine 本地缓存(对齐缓存决策「单实例部署」结论)
cache:
type: caffeine
caffeine:
spec: maximumSize=10000,expireAfterWrite=5m
# ===== 基础平台 yh 配置(UserHome 同款三件套)=====
yh:
auth:
enabled: true
sso:
server-url-prefix: http://sso.yunhaixingtong.com
# 本地 dev 必须指向前端 dev server(8073):CAS 验票回跳走 vite 代理,
# 配合前端代理的 cookiePathRewrite 才能让 JSESSIONID(path=/cms) 进入 /api 请求;
# 指回 8072 会导致 8073 页面会话死循环。生产由 projman 注入覆盖,不受此值影响。
client-host-url: http://localhost:8073
allow-headers: all
allow-origins: all
# ⚠️ 只拦管理端 API;门户 /portal/** 必须匿名可访问(SEO/首屏刚需),勿放进 pattern
url-pattern: /api/*
mobi-api-pattern: /mobiapi/*
app-auth:
enabled: true
# UserBase 注册后分配(进白名单),与 yh.open 保持一致;生产由 projman 注入
app-key: 100005
app-secret: 2c7885de594742cc840b8762910b2d2e
# 入站验签白名单:办事大厅 svc-hall(站点目录 /oapi/site/list 消费方,appKey=100018;
# P0-1 修复)。secret 与 svc-hall application.yml yh.app-auth.app-secret 逐字一致(联调态),
# 生产两侧由 projman/Nacos 注入同一密钥对
trusted-apps:
"100018": "svc-hall-dev-secret-100018"
open:
# 身份密钥唯一来源 = yh.app-auth(本文件 app-auth 段),open.* 副本已删
base-host: http://base.yunhaixingtong.com
base-path: /userbase
# 服务目录(子应用配置优化方案 §4.2):跨服务出站唯一地址来源,命名目标走 SDK 门面 /
# YschOpenCall。svc-hall 未晋升 PlatformService 枚举,按名直调(完整 URL 拆 host+ctx,
# per-target base-path 与提供方 context-path 对齐 → 签名天然一致)。
# 容器直连形态(生产):http://svc-hall-service:10007/svc-hall(网关无 /oapi 路由)。
services:
svc-hall: http://localhost:8086
# 办事大厅(svc-hall)对接(V2.0 Part C.3):门户 service/guide 数据源。
# 双向信任:CMS 出站签名用 yh.app-auth 身份(appKey=100005,办事大厅侧须在 UserBase
# 注册表内可用);入站收 svc-hall 站点目录调用(appKey=100018,见上方 trusted-apps)。
# 地址不再单独配置:见上方 yh.open.services.svc-hall(私有 legacy 回落键已随 D1 目录键归一同步改名)。
# env-config 管理端运行时配置(免登录 GET /api/env-config?target=admin,数据源见
# config/PropertyEnvConfigSource:聚合 starter 自动装配,有 bean 即注册端点)。
# 本地无需配值(前端 dev 走 .env.dev);线上值经环境变量 YH_ENV_CONFIG_SOURCE_ADMIN
# 或同名键 yh.env-config.source.admin 注入(projman 配置管理维护),未配置时端点返回 {},
# 前端走同域推导兜底(serviceHost/baseHost 正确,ssoHost 为空登录跳转不可用)。
# 如需本地联调可打开:
# env-config:
# source:
# admin: '{"baseHost":"http://base.yunhaixingtong.com","ssoHost":"http://sso.yunhaixingtong.com","serviceHost":"/yschcms","isMock":false}'
# ===== CMS 专属配置 =====
cms:
# 超管判定:BoaUser.type == 1(UserBase sys_user.type=1 平台约定,无注入配置);
# 校级权限按 currentRole.schId → site.sch_id 校验(方案 §7.2)
portal:
# 详情页浏览器缓存(秒),配合后端 5 分钟数据缓存(方案 §8.3)
detail-max-age: 300
# base 域对外基地址(C-6,方案 §8.6「未配 public_base_url 默认派生 base 域规范路径」的固化配置):
# 含 context-path,如 https://base.yunhaixingtong.com/cms;生产由 projman 注入。
# 为空(本地开发默认)时按当前请求派生(反代下经 ForwardedHeaderFilter 修正 scheme/port,B-2)。
base-origin: ""
svc:
item:
# 【V2.0 拆分遗留说明】事项库已迁独立"办事大厅"应用(svc-hall),CMS 侧 SvcItemQuery
# 由 SvcItemRemoteQuery 经 oapi 调办事大厅;本配置已废弃(部门口径归办事大厅
# svc-hall.item.dept-group-type)。保留注释防误解。
dept-group-type: 7
logging:
level:
com.yunhai.cms: debug
management:
endpoints:
web:
exposure:
include: health
endpoint:
health:
show-details: never
# 文件上传(同 UserHome 双 key 约定,方案 §7.3)
# FILE_WEB_PATH 只接受相对路径(默认 /cms/upload/,含 context-path)或公网可达绝对地址;
# 禁止填 localhost/内网绝对地址——webUrl 入库后非本机访问全部断图(B-1/C-5)。
# 门户渲染侧由 PortalUrlHelper.upload() 按访问基准补全为完整 URL。
FILE_PATH: D:/bsch/cms/upload/
FILE_WEB_PATH: /cms/upload/