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:
1 parent
ebbe64ce61
commit
feb055d4e6
10 files changed
+17
-17
No files matched your search
@@ -597,7 +597,6 @@ server:
|
||||
# 「请求体超过上限 2000000 字节」。内部网关 + nginx 两层把关,保留限制只调大数字。
|
||||
max_body_size: 20000000
|
||||
cors_origins: # CORS 允许来源(2026-11-06 由 ["*"] 收紧为白名单)
|
||||
- "https://127.0.0.1:8808"
|
||||
- "http://127.0.0.1:8808"
|
||||
- "http://localhost:8808"
|
||||
- "http://127.0.0.1:5173" # Vite dev server
|
||||
|
||||
Reference in new issue
Block a user