refactor(terminology): rename user-facing tenant labels to workspace

Align product copy, API docs, Swagger descriptions, and i18n strings
with workspace terminology while keeping internal tenant identifiers
and headers unchanged for API compatibility.
This commit is contained in:
wizardchen
2026-07-14 16:13:49 +08:00
committed by lyingbug
parent e1572b71b9
commit 41975abcc5
161 changed files with 1865 additions and 1770 deletions
+1 -1
View File
@@ -31,7 +31,7 @@ export function isAgentWebSearchReady(
return resolveAgentWebSearchProviderId(config, providers) !== null;
}
/** 租户级默认搜索引擎是否可用(无智能体约束时) */
/** 空间级默认搜索引擎是否可用(无智能体约束时) */
export function isTenantWebSearchReady(providers: WebSearchProviderEntity[]): boolean {
return providers.some((p) => p.is_default);
}
+4 -4
View File
@@ -43,14 +43,14 @@ instance.interceptors.request.use(
// 添加用户语言偏好
config.headers["Accept-Language"] = getCurrentLanguage();
// 添加跨租户访问请求头:只要 setSelectedTenant 写过激活租户,
// 添加跨空间访问请求头:只要 setSelectedTenant 写过激活空间,
// 每个请求都要附 X-Tenant-ID。早期版本会 short-circuit
// "selectedTenantId === defaultTenantId 时不附"以减少 header 体积,
// 但这条优化会被任何把 weknora_tenant 写成激活租户的代码(OIDC
// 但这条优化会被任何把 weknora_tenant 写成激活空间的代码(OIDC
// 回调、UserMenu loadUserInfo、router hydrate)触发,导致后续请求
// 静默丢失 header,前端"切换了"但实际仍跑在 home 租户里——把"切
// 静默丢失 header,前端"切换了"但实际仍跑在 home 空间里——把"切
// 换之后只有第一批请求带 X-Tenant-ID"调成永久状态。
// 后端 IsTenantAccessible 已经允许 header 指向 home 租户(自家),
// 后端 IsTenantAccessible 已经允许 header 指向 home 空间(自家),
// 所以无脑附不会引入新风险。
if (!isEmbedAuth && !isEmbedPath) {
const selectedTenantId = localStorage.getItem('weknora_selected_tenant_id');
+1 -1
View File
@@ -2,7 +2,7 @@
//
// Switching the active tenant always lands the user on the platform's KB
// list. 之前是「在当前路径 reload」+ 个别敏感路径回退到 KB 列表,但即便不带
// resource id 的页面(设置、Agent 列表等)reload 后也常常因为新租户下没有
// resource id 的页面(设置、Agent 列表等)reload 后也常常因为新空间下没有
// 对应数据出现空状态,体验跟跳到固定首页其实差不多——干脆统一跳到 KB 列表,
// 用一次 full navigation 把所有 store / SSE / 请求都重置一遍。