初始化
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
/**
|
||||
* 环境配置
|
||||
*/
|
||||
|
||||
/** 当前环境,手动切换 */
|
||||
const ENV = 'dev'
|
||||
|
||||
/** 各环境配置 */
|
||||
const envConfigs: Record<string, {
|
||||
dataBaseApi: string
|
||||
aiBaseApi: string
|
||||
cookieSourceUrl: string
|
||||
}> = {
|
||||
dev: {
|
||||
dataBaseApi: 'http://localhost:8080/api',
|
||||
aiBaseApi: 'http://localhost:8000',
|
||||
cookieSourceUrl: 'http://192.168.31.135:5173',
|
||||
},
|
||||
prod: {
|
||||
dataBaseApi: 'https://your-domain.com/api',
|
||||
aiBaseApi: 'https://your-domain.com/ai',
|
||||
cookieSourceUrl: 'https://your-domain.com',
|
||||
},
|
||||
}
|
||||
|
||||
/** 根据当前环境返回配置 */
|
||||
export function getConfig() {
|
||||
return envConfigs[ENV] || envConfigs.dev
|
||||
}
|
||||
|
||||
export const config = getConfig()
|
||||
Reference in New Issue
Block a user