feat(W4): 院系子站嵌套路径-cms_site.path列+uk_site_path/parent_code,门户单段+嵌套双映射,旧链301,public_base_url派生,sitePath预览,SQL三处+升级脚本,T-W4-01..15 全绿279/279

This commit is contained in:
chenxing
2026-09-08 12:34:33 +08:00
parent 5da6f7ee5d
commit 536bd6cea4
30 changed files with 593 additions and 55 deletions
+4 -2
View File
@@ -8,7 +8,8 @@
-- 1. 站点表(多租户根;一校一主站 + N 院系子站,见《院系子站方案.md》)
CREATE TABLE IF NOT EXISTS `cms_site` (
`id` INT NOT NULL AUTO_INCREMENT COMMENT '主键',
`code` VARCHAR(64) NOT NULL COMMENT '站点编码,URL 路径用(/portal/{code})',
`code` VARCHAR(64) NOT NULL COMMENT '站点编码(URL 末段;W4 起不再全局唯一)',
`path` VARCHAR(191) NOT NULL DEFAULT '' COMMENT '门户路径(顶层=code;子站=父path/code),URL 唯一标识',
`parent_site_id` INT NOT NULL DEFAULT 0 COMMENT '上级站点ID(0=顶层校站点;院系子站挂主站 id,层级固定两层)',
`sch_id` INT NULL COMMENT '学校ID(逻辑外键 → UserBase sys_group.id)',
`sch_name` VARCHAR(128) NULL COMMENT '学校名称(冗余展示)',
@@ -21,7 +22,8 @@ CREATE TABLE IF NOT EXISTS `cms_site` (
`update_by` VARCHAR(64) NULL,
`update_time` DATETIME NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `uk_site_code` (`code`),
UNIQUE KEY `uk_site_path` (`path`),
UNIQUE KEY `uk_site_parent_code` (`parent_site_id`, `code`),
KEY `idx_site_sch` (`sch_id`),
KEY `idx_site_parent` (`parent_site_id`)
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COMMENT = 'CMS 站点(一校一主站 + N 院系子站)';
@@ -20,8 +20,8 @@
<i class="colleges-arrow">▾</i>
</span>
<ul class="colleges-menu">
<li th:each="col : ${site.colleges}" th:classappend="${col.code == site.code} ? 'active'">
<a th:href="${url.siteHome(col.code, col.publicBaseUrl)}"
<li th:each="col : ${site.colleges}" th:classappend="${col.path == site.path} ? 'active'">
<a th:href="${url.siteHome(col.path, col.publicBaseUrl)}"
th:title="${col.name}" th:text="${col.name}">学院名称</a>
</li>
</ul>
@@ -21,8 +21,8 @@
<i class="colleges-arrow">▾</i>
</span>
<ul class="colleges-menu">
<li th:each="col : ${site.colleges}" th:classappend="${col.code == site.code} ? 'active'">
<a th:href="${url.siteHome(col.code, col.publicBaseUrl)}"
<li th:each="col : ${site.colleges}" th:classappend="${col.path == site.path} ? 'active'">
<a th:href="${url.siteHome(col.path, col.publicBaseUrl)}"
th:title="${col.name}" th:text="${col.name}">学院名称</a>
</li>
</ul>
@@ -17,8 +17,8 @@
<i class="colleges-arrow" aria-hidden="true">▾</i>
</span>
<ul class="colleges-menu">
<li th:each="col : ${site.colleges}" th:classappend="${col.code == site.code} ? 'active'">
<a th:href="${url.siteHome(col.code, col.publicBaseUrl)}"
<li th:each="col : ${site.colleges}" th:classappend="${col.path == site.path} ? 'active'">
<a th:href="${url.siteHome(col.path, col.publicBaseUrl)}"
th:title="${col.name}" th:text="${col.name}">学院名称</a>
</li>
</ul>
@@ -17,8 +17,8 @@
<i class="sp-colleges-arrow" aria-hidden="true">▾</i>
</span>
<ul class="sp-colleges-menu">
<li th:each="col : ${site.colleges}" th:classappend="${col.code == site.code} ? 'active'">
<a th:href="${url.siteHome(col.code, col.publicBaseUrl)}"
<li th:each="col : ${site.colleges}" th:classappend="${col.path == site.path} ? 'active'">
<a th:href="${url.siteHome(col.path, col.publicBaseUrl)}"
th:title="${col.name}" th:text="${col.name}">学院名称</a>
</li>
</ul>
@@ -20,8 +20,8 @@
<i class="colleges-arrow">▾</i>
</span>
<ul class="colleges-menu">
<li th:each="col : ${site.colleges}" th:classappend="${col.code == site.code} ? 'active'">
<a th:href="${url.siteHome(col.code, col.publicBaseUrl)}"
<li th:each="col : ${site.colleges}" th:classappend="${col.path == site.path} ? 'active'">
<a th:href="${url.siteHome(col.path, col.publicBaseUrl)}"
th:title="${col.name}" th:text="${col.name}">学院名称</a>
</li>
</ul>