完成50%
This commit is contained in:
+7
-1
@@ -1,9 +1,15 @@
|
||||
export const runtimeConfig = {
|
||||
mode: 'mock',
|
||||
baseUrl: 'http://182.61.18.23:8080',
|
||||
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')
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user