refactor(frontend): 地址栏改成动态显示当前 host,不再写死任何域名

上次 filter-repo 把 api.wangjinding.com 直接替换成 127.0.0.1:8808,
是写死的 —— 用户从自己域名访问时会显示错误的地址。

这次改成 location.host:
  · SideNav 的 logo 下方 → {{ apiHost }}(= location.host)
  · MainLayout 副标题兜底 → location.host
  · i18n 的「已连接 <域名>」→「已连接」
  · 前端重新 build(不是打补丁),产物里没有任何写死的地址

实测:
  http://localhost:8808  → 侧栏 localhost:8808 | 已连接
  http://127.0.0.1:8808  → 侧栏 127.0.0.1:8808 | 已连接

顺带修掉 filter-repo 留下的一个错误 scheme:
  gateway.yaml 的 cors 里出现了 https://127.0.0.1:8808(应为 http),已删除。
This commit is contained in:
Jidekin committed 2026-11-20 17:22:32 +08:00
1 parent ebbe64ce61
commit feb055d4e6
10 files changed
+17 -17

No files matched your search

+1 -1
View File
@@ -292,7 +292,7 @@
<div class="shot">
<div class="shot-bar"><i></i><i></i><i></i><span>终端 — 换一个 model,就换一家供应商</span></div>
<pre class="term"><code><span class="c-com"># 同一个接口,model 决定走向哪一家</span>
<span class="c-p">$</span> curl https://127.0.0.1:8808/v1/chat/completions \
<span class="c-p">$</span> curl http://127.0.0.1:8808/v1/chat/completions \
-H <span class="c-s">"Authorization: Bearer sk-你的key"</span> \
-d <span class="c-s">'{"model": "agnes-3.0-flash",
"messages": [{"role":"user","content":"你好"}]}'</span>