Files
jiapuapp/utils/config.js
T
2026-07-23 08:24:07 +08:00

16 lines
563 B
JavaScript

export const runtimeConfig = {
mode: 'mock',
baseUrl: 'https://backend-api.ddxcjp.cn',
clientId: '428a8310cd442757ae699df5d894f051',
tenantId: '000000'
}
export const isMockMode = () => runtimeConfig.mode === 'mock'
export const hasRemoteConfig = () => runtimeConfig.mode === 'remote' && Boolean(runtimeConfig.baseUrl && runtimeConfig.clientId)
export const resolveRuntimeMode = () => {
if (isMockMode()) return 'mock'
if (hasRemoteConfig()) return 'remote'
throw new Error('运行模式配置无效:只允许 mock 或配置完整的 remote')
}