Ver Fonte

增加教育学院单页真实内容发布校验

HXCS 发布验证新增学院简介正文发布日期检查,避免 HTTP 200 但实际仍显示模板初始占位内容。\n\nValidation:\n- bash -n 通过\n- git diff --cached --check 通过
非繁 há 3 semanas atrás
pai
commit
f6c2814eb3
1 ficheiros alterados com 18 adições e 0 exclusões
  1. 18 0
      local-run/bin/sync-to-hxcs-prod.sh

+ 18 - 0
local-run/bin/sync-to-hxcs-prod.sh

@@ -745,6 +745,21 @@ verify_http() {
 	fi
 }
 
+verify_http_contains() {
+	local label="$1"
+	local url="$2"
+	local pattern="$3"
+	local body code
+	body="$(curl -k -s -m 20 -w "\n%{http_code}" "${url}" || true)"
+	code="${body##*$'\n'}"
+	if [[ "${code}" =~ ^(200|301|302|304)$ && "${body}" == *"${pattern}"* ]]; then
+		ok "${label}(HTTP ${code})"
+	else
+		fail "${label}(HTTP ${code:-000},缺少内容:${pattern})"
+		VERIFY_FAILED=1
+	fi
+}
+
 verify_remote_file_contains() {
 	local label="$1"
 	local rel_path="$2"
@@ -1565,6 +1580,9 @@ SELECT IF(
 	verify_http "教育学院-2026 首页可访问" "https://ffkj-education-2026.hxcs.feifan.net/"
 	verify_http "教育学院-2026 学院概况列表可访问" "https://ffkj-education-2026.hxcs.feifan.net/xueyuangaikuang/"
 	verify_http "教育学院-2026 学院简介单页可访问" "https://ffkj-education-2026.hxcs.feifan.net/xueyuangaikuang/xueyuanjianjie/"
+	verify_http_contains "教育学院-2026 学院简介显示真实复制文章" \
+		"https://ffkj-education-2026.hxcs.feifan.net/xueyuangaikuang/xueyuanjianjie/" \
+		"2026-04-03"
 	verify_http "教育学院-2026 新闻动态列表可访问" "https://ffkj-education-2026.hxcs.feifan.net/xinwentonggao/xinwendongtai/"
 	verify_http "教育学院-2026 新闻正文可访问" "https://ffkj-education-2026.hxcs.feifan.net/education/EDU000000011.htm"
 	verify_http "教育学院-2026 站内搜索可访问" "https://ffkj-education-2026.hxcs.feifan.net/search?str=%E6%95%99%E8%82%B2"