Files
martial-admin-mini/config/env.config.js
DevOps 7620d9bf96 feat: 更新评分相关页面和API配置
- 更新环境配置文件
- 修改运动员和评分API
- 优化登录、评分详情、评分列表等页面
- 更新pages.json和vue.config.js配置

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-19 14:43:16 +08:00

75 lines
1.6 KiB
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.
/**
* 环境配置文件
* 控制应用的数据源模式Mock数据 或 真实API
*
* 使用说明:
* 1. Mock模式UI演示、前端独立开发设置 dataMode: 'mock'
* 2. API模式真实数据对接设置 dataMode: 'api'
* 3. 可在代码中动态切换模式
*/
const ENV_CONFIG = {
// 开发环境配置
development: {
// 数据模式: 'mock' | 'api'
// mock - 使用本地Mock数据保护UI版本
// api - 调用真实后端接口
dataMode: 'api',
// API基础路径dataMode为'api'时使用)
// uni.request 不支持 devServer proxy必须用完整地址
apiBaseURL: 'http://142.91.105.230:8123',
// 调试模式
debug: true,
// 请求超时时间(毫秒)
timeout: 30000,
},
// 测试环境配置
test: {
dataMode: 'api',
apiBaseURL: 'http://test-api.yourdomain.com',
debug: true,
timeout: 30000,
mockDelay: 0
},
// 生产环境配置
production: {
dataMode: 'api',
apiBaseURL: 'https://api.yourdomain.com',
debug: false,
timeout: 30000,
mockDelay: 0
}
}
// 获取当前环境(开发/测试/生产)
const env = process.env.NODE_ENV || 'development'
// 导出当前环境的配置
export default {
...ENV_CONFIG[env],
env
}
/**
* 快速切换数据模式示例:
*
* // 在代码中使用
* import config from '@/config/env.config.js'
*
* if (config.dataMode === 'mock') {
* console.log('当前使用Mock数据')
* } else {
* console.log('当前使用真实API')
* }
*
* // 查看当前环境
* console.log('当前环境:', config.env)
* console.log('数据模式:', config.dataMode)
*/