Files
tiku-backend.net/Tiku.Api/wwwroot/platform-admin/runtime-config.js

25 lines
871 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
* 平台端公开运行时配置。
*
* 默认连接同源后端。其他部署环境可在本文件之前注入同名对象,
* 或在部署时替换本文件。不要把 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() || '',
};