restore gpt seo copy pipeline and stabilize seo tkd output

This commit is contained in:
root
2026-04-16 22:45:00 +08:00
parent 09b2137fa6
commit 2a905bbf0f
18 changed files with 3587 additions and 85 deletions

View File

@@ -51,6 +51,11 @@ if ($strTmpCode == 'videoGpt1') {
return $SiteContext->getSiteMapByCode('VIDEO');
})->ext('xml');
// 榜单首页历史深链优先硬绑定,避免被通用 rank_list 模式误吞到列表页模板。
Route::get('/phb-index', function () {
return view('video/getRankIndex.html');
});
// ========== 1⃣ 取当前域名冻结的 family ==========
$tpStyle = SiteStyle::getConfig();
$family = $tpStyle['template_cfg']['url_family'];
@@ -75,6 +80,21 @@ if ($strTmpCode == 'videoGpt1') {
}
$registered[$route] = true;
// 兼容带 .html 的冻结路径。
// ThinkPHP 在旧路由里普遍使用 "/path" + ->ext('html')
// 而当前 family 里有一部分站点会直接冻结成 "/get.html"、"/record.html"。
// 这里同时补一个无后缀别名,避免这类路径在 GPT 新路由分支下落不到视图。
if (str_ends_with($route, '.html')) {
$routeWithoutExt = substr($route, 0, -5);
if ($routeWithoutExt !== '' && !isset($registered[$routeWithoutExt])) {
$alias = Route::get($routeWithoutExt, fn() => view($view))->ext('html');
if ($pattern) {
$alias->pattern($pattern);
}
$registered[$routeWithoutExt] = true;
}
}
};
// ========== 2.5️⃣ 冻结前按 sort 排序 ==========
@@ -126,7 +146,7 @@ if ($strTmpCode == 'videoGpt1') {
break;
case 'category_home':
$register($route, 'video/getCategory.html');
$register($route, 'video/getMap.html');
break;
case 'category_parent':
$register($route, 'video/getCategoryType.html',[
@@ -167,7 +187,7 @@ if ($strTmpCode == 'videoGpt1') {
$register($route, 'video/getRankIndex.html');
break;
case 'rank_list':
$register($route, 'video/getRankIndex.html',[
$register($route, 'video/getRankList.html',[
'strParentCategory' => '[a-z\-]*', // 允许空值
'strCategory' => '[a-z\-]*', // 允许空值
'strSortType' => '[a-z\-]*', // 允许空值
@@ -851,7 +871,7 @@ if ($strTmpCode == 'videoGpt1') {
],
//排行榜
'video_rank_index' => ['/paihang/index', '/rank/index', '/paihang-quan', '/top/index', '/paihang-bang', '/ranks/index', '/sort/index', '/order/index', '/phb/index'],
'video_rank_index' => ['/paihang/index', '/rank/index', '/paihang-quan', '/top/index', '/paihang-bang', '/ranks/index', '/sort/index', '/order/index', '/phb/index', '/phb-index'],
//排行榜
'video_rank_list' => [