修复大陆版构建未重写 openapi.longbridge.com 为 .cn#1057
Merged
Merged
Conversation
扩展 region URL 重写机制,补齐遗漏的 API 域名: - region-filter.ts:markdown 渲染新增 openapi.longbridge.com → apiBaseUrl - config.mts transformHtml:最终 HTML 同步重写 API 域名 - config.mts buildEnd:install 脚本重写覆盖 site + API 双域名
d7bc20b to
75b2cb9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
合入判断
[APPROVE] — 大陆版 region 重写机制扩展,补齐遗漏的 API 域名,无显著风险
变更概要
regionConfig的 URL 重写:在 markdown 渲染、HTML 输出、install 静态脚本三处统一新增openapi.longbridge.com → apiBaseUrl(cn 版即.cn),与原有open.longbridge.com → siteHostname并列[from, to][]数组循环,方便后续再添加其它待重写域名docs/public/longbridge-terminal/install第 8 行硬编码.cn的残留,统一为全球默认.com,由构建期 region 重写在 cn 构建时统一换回.cn风险分析
open与openapi在第 12 字符就分叉),串行split/join安全regionCfg为undefined,新条件分支不进入;install 源文件改回.com后全球版表现一致.longbridge.com残留.cn→.com影响生产.cn;全球版本就该用.com设计决策
代码关注点
apiBaseUrl是 origin 还是带 path (docs/.vitepress/md-plugins/region-filter.ts:18)regionConfig.cn.apiBaseUrl = 'https://openapi.longbridge.cn'不带末尾/,与被替换的https://openapi.longbridge.com一致,目前安全;若未来配置改成带 path/trailing slash 会导致 URL 拼接错位,reviewer 拍板是否在配置层加格式校验.md副本和llms.txt未走 region 过滤 (docs/.vitepress外的copy-routes.ts/generate-llms.ts)产物里
.md/llms.txt仍含.com(独立生成链路,不经 markdown 插件),本次 scope 不处理;如需大陆版 AI 消费副本也走.cn,需单独 PR 给那两个脚本加 region 化验证状态
✅ 本地
bun run build:cn构建成功(170 行输出,1 warning,无 error) · ✅ dist HTML 全量扫描零.longbridge.com残留 · ✅ install / install.ps1 产物 5/5 处全部.cn· 📋 需 reviewer 验证:线上open.longbridge.cn实际访问 mcp / skill 页面域名展示