refactor(validators,main): 重构 Lua 配置解析与校验逻辑,提取 LuaValidator 模块; 抽离进程执行与 Win32 提权逻辑

- 重构 Lua 配置解析与校验逻辑
- 将控制台事件监听与 UAC 提权执行逻辑迁移至 win.rs 模块
- 简化 main 函数,提升代码可读性与模块化程度
- 清理废弃的注释代码
This commit is contained in:
2026-08-24 20:27:35 +08:00
parent 75103dae3c
commit 0ac7a07133
12 changed files with 1361 additions and 455 deletions

7
src/utils.rs Normal file
View File

@@ -0,0 +1,7 @@
use std::path::Path;
pub fn normalize_path_for_lua(path: &Path) -> String {
// 自动将 Windows UNC 规范路径转回传统路径
let simplified = dunce::simplified(path);
simplified.to_string_lossy().replace('\\', "/")
}