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
@@ -111,7 +111,7 @@ class PreviewApiIT extends CmsIntegrationTestBase {
@DisplayName("T23: 预览按指定主题渲染(含站点名与主题标记)")
void previewRendersSpecifiedTheme() throws Exception {
MvcResult result = standalone.perform(get("/api/theme/preview")
.param("siteCode", "demo").param("theme", "t-demo-red"))
.param("sitePath", "demo").param("theme", "t-demo-red"))
.andExpect(status().isOk()).andReturn();
String html = body(result);
assertThat(html).contains("预览内容源门户");
@@ -122,7 +122,7 @@ class PreviewApiIT extends CmsIntegrationTestBase {
@DisplayName("T24: 预览注入 p_ 参数(p_primary=#b01a2e → --primary:#b01a2e)")
void previewInjectsParams() throws Exception {
MvcResult result = standalone.perform(get("/api/theme/preview")
.param("siteCode", "demo").param("theme", "t-demo-red")
.param("sitePath", "demo").param("theme", "t-demo-red")
.param("p_primary", "#b01a2e"))
.andExpect(status().isOk()).andReturn();
assertThat(body(result)).contains("--primary:#b01a2e");
@@ -132,7 +132,7 @@ class PreviewApiIT extends CmsIntegrationTestBase {
@DisplayName("T25: 预览资产指向管理端代理(R1 串包修复的核心断言)")
void previewAssetsPointToAdminProxy() throws Exception {
MvcResult result = standalone.perform(get("/api/theme/preview")
.param("siteCode", "demo").param("theme", "t-demo-red"))
.param("sitePath", "demo").param("theme", "t-demo-red"))
.andExpect(status().isOk()).andReturn();
assertThat(body(result)).contains("/api/theme/t-demo-red/asset/css/main.css");
}
@@ -142,7 +142,7 @@ class PreviewApiIT extends CmsIntegrationTestBase {
void previewAssetHrefCarriesContextPathEndToEnd() throws Exception {
MvcResult result = standalone.perform(get("/yschcms/api/theme/preview")
.contextPath("/yschcms")
.param("siteCode", "demo").param("theme", "t-demo-red"))
.param("sitePath", "demo").param("theme", "t-demo-red"))
.andExpect(status().isOk()).andReturn();
assertThat(body(result))
.contains("href=\"/yschcms/api/theme/t-demo-red/asset/css/main.css\"");
@@ -152,7 +152,7 @@ class PreviewApiIT extends CmsIntegrationTestBase {
@DisplayName("T26: 预览响应 no-store(不进缓存/CDN)")
void previewNoStore() throws Exception {
standalone.perform(get("/api/theme/preview")
.param("siteCode", "demo").param("theme", "default"))
.param("sitePath", "demo").param("theme", "default"))
.andExpect(header().string("Cache-Control", "no-store"));
}