You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1.3 KiB
1.3 KiB
数据配置使用指南
概述
本系统支持通过JSON配置文件来管理所有模块的数据,方便在部署时进行数据修改而无需重新编译代码。
配置文件位置
- 开发环境:
public/data-config.json - 生产环境: 部署后的
/data-config.json文件
主要数据模块
1. 实时交易统计 (realTimeStats)
- todayTransactions: 今日交易笔数
- totalAmount: 交易总额(万元)
- activeUsers: 活跃用户数
- systemStatus: 系统状态
2. 牦牛交易数据 (yakTradingData)
- totalCount: 总交易数量
- avgPrice: 平均价格
- monthlyGrowth: 月增长率(%)
- topRegion: 主要地区
部署时修改数据
方法一:直接修改JSON文件
- 找到部署目录下的
data-config.json文件 - 使用文本编辑器打开文件
- 修改对应的数据值
- 保存文件
- 刷新浏览器页面即可看到更新
方法二:替换整个配置文件
- 准备新的
data-config.json文件 - 替换部署目录下的原文件
- 刷新浏览器页面
注意事项
- JSON格式: 确保修改后的文件符合JSON格式规范
- 数据类型: 注意保持数据类型一致(数字、字符串、数组等)
- 编码格式: 文件应保存为UTF-8编码
- 备份: 修改前建议备份原文件