feat(web,backend,lua,installer): 新增Lua脚本版本管理功能及相关优化
- 升级售票机、检票机内置Lua脚本版本至v1.5.8 - 新增后端配置的lua_versions字段,统一管理售票机、检票机的Lua脚本版本 - 前端新增版本管理配置页面,支持版本号配置和一键补丁升级 - 为售票机、检票机添加远程版本检测功能,屏幕显示版本匹配状态标记 - 简化installer配置交互流程,优化站点代码输入方式 - 重构后端配置规范化处理逻辑,统一配置初始化与存储流程 - 优化售票机外设检测、支付检测逻辑,修复部分已知问题
This commit is contained in:
+12
-4
@@ -148,14 +148,16 @@ const resolveCurrentStationCode = (body, resolveStation) => {
|
||||
|
||||
// Config
|
||||
router.get('/config', (req, res) => {
|
||||
const cfg = DataService.getConfig();
|
||||
res.json({
|
||||
api_base: DataService.getConfig().api_base,
|
||||
current_station: DataService.getConfig().current_station,
|
||||
api_base: cfg.api_base,
|
||||
current_station: cfg.current_station,
|
||||
stations: DataService.getStations(),
|
||||
lines: DataService.getLines(),
|
||||
fares: DataService.getFares(),
|
||||
transfers: DataService.getConfig().transfers || [],
|
||||
promotion: DataService.getConfig().promotion || { name: '', discount: 1 }
|
||||
transfers: cfg.transfers || [],
|
||||
promotion: cfg.promotion || { name: '', discount: 1 },
|
||||
lua_versions: cfg.lua_versions || {}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -219,6 +221,12 @@ router.put('/config', async (req, res) => {
|
||||
if (!(d >= 0 && d <= 1)) return res.status(400).json({ ok: false, error: 'promotion.discount must be between 0 and 1' });
|
||||
cfg.promotion = { name: String(p.name || ''), discount: d };
|
||||
}
|
||||
if (incoming.lua_versions && typeof incoming.lua_versions === 'object') {
|
||||
cfg.lua_versions = {
|
||||
...(cfg.lua_versions || {}),
|
||||
...(incoming.lua_versions || {})
|
||||
};
|
||||
}
|
||||
await DataService.saveConfig(cfg);
|
||||
appendReqLog(req, { category: 'admin', type: 'update_config_generic', detail: incoming });
|
||||
io.emit('config:updated', cfg);
|
||||
|
||||
Reference in New Issue
Block a user