fix(studio): hide sidebar group until token resolves; remove VITE_STUDIO_ENABLED
- workspace-nav-studio: return null while isLoading so the "工作室" group no longer briefly mounts and then unmounts when getTokenByEmail returns "用户不存在" (404). Skeleton branch became dead code, removed. - studio/hooks: switch all three token queries from retry: 1 to false — account-not-found is a permanent error; retry just doubled isError latency. - env: drop VITE_STUDIO_ENABLED everywhere (env.ts + 7 env files + workspace-nav-chat-list). Sidebar availability is now decided at runtime by token success instead of a build-time flag. - env: add VITE_AIPI_PRESENT_URL + VITE_AIPI_KNOWES_URL for the document upload popup's A-system jump + B-system knowledge iframe; reuse the existing VITE_AIPI_KNOWLEDGE_URL for the Y-system iframe. - document-upload-popup: replace 8 hardcoded URLs (6 present, 1 knowes, 1 knowlibrary) with the corresponding env vars. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
bd0eceda61
commit
4416348c51
13 files changed
+287
-80
No files matched your search
@@ -9,8 +9,7 @@ function readEnv(
|
||||
| "VITE_AIPI_BACKENP_URL"
|
||||
| "VITE_AIPI_FRONTEND_URL"
|
||||
| "VITE_STATIC_WEBSITE_ONLY"
|
||||
| "VITE_GITHUB_OAUTH_TOKEN"
|
||||
| "VITE_STUDIO_ENABLED",
|
||||
| "VITE_GITHUB_OAUTH_TOKEN",
|
||||
): EnvValue {
|
||||
const value = import.meta.env[key];
|
||||
return typeof value === "string" && value.trim() ? value : undefined;
|
||||
@@ -26,5 +25,4 @@ export const env = {
|
||||
NEXT_PUBLIC_NOTEBOOK_API_BASE_URL: readEnv("VITE_AIPI_BACKENP_URL"),
|
||||
NEXT_PUBLIC_STATIC_WEBSITE_ONLY: readEnv("VITE_STATIC_WEBSITE_ONLY"),
|
||||
GITHUB_OAUTH_TOKEN: readEnv("VITE_GITHUB_OAUTH_TOKEN"),
|
||||
STUDIO_ENABLED: readEnv("VITE_STUDIO_ENABLED"),
|
||||
};
|
||||
Reference in new issue
Block a user