feat: 添加 AI 查询页面固定链接支持

- 注册 /ai-query 和 /ai-query/{CODE} 路由

- 支持 URL 路径参数传递识别码

- 更新所有识别码链接为固定链接格式

- 与友链、反馈页面保持一致的实现方式
This commit is contained in:
2026-01-20 23:05:06 +08:00
parent 1427fada10
commit 43d6a44dec
3 changed files with 24 additions and 4 deletions

View File

@@ -76,7 +76,7 @@ $model_display = !empty($model) ? $model : __('未知模型', 'argon');
<span class="ai-summary-model"><?php _e('使用模型', 'argon'); ?>: <?php echo esc_html($model_display); ?></span>
<?php endif; ?>
<?php if (!empty($summary_code)): ?>
<span class="ai-summary-code"><?php _e('识别码', 'argon'); ?>: <a href="<?php echo get_template_directory_uri(); ?>/ai-summary-query.php?code=<?php echo esc_attr($summary_code); ?>"><?php echo esc_html($summary_code); ?></a></span>
<span class="ai-summary-code"><?php _e('识别码', 'argon'); ?>: <a href="<?php echo home_url('/ai-query/' . esc_attr($summary_code)); ?>"><?php echo esc_html($summary_code); ?></a></span>
<?php endif; ?>
<?php endif; ?>
</div>
@@ -121,7 +121,7 @@ $model_display = !empty($model) ? $model : __('未知模型', 'argon');
footerHTML += '<span class="ai-summary-model"><?php _e('使用模型', 'argon'); ?>: ' + data.data.model + '</span>';
}
if (data.data.code) {
footerHTML += '<span class="ai-summary-code"><?php _e('识别码', 'argon'); ?>: <a href="<?php echo get_template_directory_uri(); ?>/ai-summary-query.php?code=' + data.data.code + '">' + data.data.code + '</a></span>';
footerHTML += '<span class="ai-summary-code"><?php _e('识别码', 'argon'); ?>: <a href="<?php echo home_url('/ai-query/'); ?>' + data.data.code + '">' + data.data.code + '</a></span>';
}
footerDiv.innerHTML = footerHTML;
}