/** * 前端 bootstrap:silo org slug(拼飞书 OAuth 链接用)+ dev 一键登录开关。 * * 打 `/database/config` 而非 `/database/api/login-info`:后者由 teacherApp.ts 在 * silo org 查找成功之后才注册,org 缺失时整条链路不存在;前者在 * databaseRoutes.ts 顶部无条件注册。两者形状相同(见 src/database/README.md)。 * * 免鉴权 —— org slug 本就出现在 OAuth URL 里,不构成敏感信息。 */ import { api } from "./api.js"; export interface AppConfig { readonly orgSlug: string; readonly devLoginEnabled: boolean; } let cached: AppConfig | null = null; export async function loadConfig(): Promise { if (cached !== null) return cached; cached = await api("/database/config"); return cached; }