diff --git a/Tiku.Api/wwwroot/platform-admin/app.js b/Tiku.Api/wwwroot/platform-admin/app.js index 5c5c918..c390722 100644 --- a/Tiku.Api/wwwroot/platform-admin/app.js +++ b/Tiku.Api/wwwroot/platform-admin/app.js @@ -343,13 +343,13 @@ function saveData() { } } function backendStatusLabel() { - if (!platformApi?.isEnabled()) return '静态演示数据'; + if (!platformApi?.isEnabled()) return '演示模式可用'; if (state.apiConnection === 'connecting') return '正在连接后端'; if (state.apiConnection === 'connected') { const partial = state.apiFailedOperations ? ` · ${state.apiFailedOperations} 项无权限/失败` : ''; return `后端已连接${partial}`; } - return '后端不可用 · 已保留静态演示'; + return '演示模式可用'; } function backendErrorText(error, fallback = '平台接口请求失败') { if (!error) return fallback; @@ -427,7 +427,7 @@ async function hydrateFromBackend({ silent = false } = {}) { state.apiConnection = 'degraded'; state.apiFailedOperations = 1; render(); - if (!silent) showToast(`${backendErrorText(error, '后端连接失败')} · 已保留静态演示`, 'error'); + if (!silent) showToast(`${backendErrorText(error, '后端连接失败')} · 已切换至演示模式`, 'error'); return false; } } diff --git a/Tiku.Api/wwwroot/platform-admin/index.html b/Tiku.Api/wwwroot/platform-admin/index.html index b639380..8eb5e75 100644 --- a/Tiku.Api/wwwroot/platform-admin/index.html +++ b/Tiku.Api/wwwroot/platform-admin/index.html @@ -8,11 +8,11 @@ - + - + diff --git a/Tiku.Api/wwwroot/platform-admin/runtime-config.js b/Tiku.Api/wwwroot/platform-admin/runtime-config.js index cc4d436..2f872bc 100644 --- a/Tiku.Api/wwwroot/platform-admin/runtime-config.js +++ b/Tiku.Api/wwwroot/platform-admin/runtime-config.js @@ -1,7 +1,7 @@ /* * 平台端公开运行时配置。 * - * 默认连接同源后端。其他部署环境可在本文件之前注入同名对象, + * 默认使用可交互演示数据。其他部署环境可在本文件之前注入同名对象, * 或在部署时替换本文件。不要把 access token、service role key 或任何服务端密钥 * 写入静态文件;getAccessToken 应从当前平台登录会话中按需读取短期 JWT。 * @@ -16,9 +16,9 @@ * }; */ window.GONGXUE_PLATFORM_RUNTIME_CONFIG = window.GONGXUE_PLATFORM_RUNTIME_CONFIG || { - mode: 'api', + mode: 'mock', apiBaseUrl: '', - fallbackToMock: false, + fallbackToMock: true, timeoutMs: 10000, getAccessToken: async () => window.GongxuePlatformAuth?.getAccessToken() || '', };