Files
template-10519/config/env.ts
赵忠林 cd7de05e33 feat(hjm/violation): 实现违章记录编辑功能
- 添加编辑模式支持,通过路由参数id判断是否为编辑状态
- 实现获取违章记录详情并填充表单功能
- 区分新增和编辑模式的提交逻辑- 编辑模式下禁用车辆编号输入框- 添加页面间通信机制,支持列表页刷新
- 实现违章记录删除功能
- 更新页面标题根据模式动态显示
- 修改按钮文字根据操作状态显示不同文案
- 调整开发环境API基础URL配置
- 优化请求工具中的本地开发地址配置
2025-10-14 17:20:47 +08:00

43 lines
889 B
TypeScript

// 环境变量配置
export const ENV_CONFIG = {
// 开发环境
development: {
API_BASE_URL: 'http://127.0.0.1/api',
APP_NAME: '开发环境',
DEBUG: 'true',
},
// 生产环境
production: {
API_BASE_URL: 'https://cms-api.websoft.top/api',
APP_NAME: '时里院子市集',
DEBUG: 'false',
},
// 测试环境
test: {
API_BASE_URL: 'https://cms-api.s209.websoft.top/api',
APP_NAME: '测试环境',
DEBUG: 'true',
}
}
// 获取当前环境配置
export function getEnvConfig() {
const env = process.env.NODE_ENV || 'development'
if (env === 'production') {
return ENV_CONFIG.production
} else { // @ts-ignore
if (env === 'test') {
return ENV_CONFIG.test
} else {
return ENV_CONFIG.development
}
}
}
// 导出环境变量
export const {
API_BASE_URL,
APP_NAME,
DEBUG
} = getEnvConfig()