feat: bootstrap local platform development

This commit is contained in:
2026-07-28 17:01:44 +08:00
parent 5732df8886
commit e7d350ec3d
19 changed files with 3230 additions and 7 deletions

View File

@@ -0,0 +1,24 @@
/*
* 平台端公开运行时配置。
*
* 默认连接同源后端。其他部署环境可在本文件之前注入同名对象,
* 或在部署时替换本文件。不要把 access token、service role key 或任何服务端密钥
* 写入静态文件getAccessToken 应从当前平台登录会话中按需读取短期 JWT。
*
* window.GONGXUE_PLATFORM_RUNTIME_CONFIG = {
* mode: 'api',
* apiBaseUrl: 'https://api.example.com',
* fallbackToMock: true,
* timeoutMs: 10000,
* getAccessToken: async () => {
* return sessionStorage.getItem('tiku_platform_access_token') || '';
* },
* };
*/
window.GONGXUE_PLATFORM_RUNTIME_CONFIG = window.GONGXUE_PLATFORM_RUNTIME_CONFIG || {
mode: 'api',
apiBaseUrl: '',
fallbackToMock: false,
timeoutMs: 10000,
getAccessToken: async () => window.GongxuePlatformAuth?.getAccessToken() || '',
};