mirror of
https://github.com/LHY0125/PathEditor.git
synced 2026-06-29 01:45:54 +08:00
build, fix, feat, refactor: 优化长列表性能,新增注册表并发校验,升级v5.1.0
- 前端引入@tanstack/react-virtual虚拟列表库,重构PathTable与MergePreview组件,优化大量路径条目下的渲染性能 - 为后端注册表保存接口添加原始路径比对逻辑,防止并发修改导致的配置覆盖,同步更新前端保存逻辑传递原始路径参数 - 替换core模块手动编写的Windows API FFI声明为windows-sys官方库,简化代码维护 - 完善单元测试,新增空数组处理、边界场景的测试用例 - 更新项目依赖与锁定文件,将版本升级至v5.1.0 - 新增项目代码架构审查文档
This commit is contained in:
@@ -9,10 +9,22 @@ pub fn load_user_paths() -> Result<Vec<String>, String> {
|
||||
registry::load_user_paths()
|
||||
}
|
||||
#[tauri::command]
|
||||
pub fn save_system_paths(paths: Vec<String>) -> Result<(), String> {
|
||||
pub fn save_system_paths(paths: Vec<String>, original: Option<Vec<String>>) -> Result<(), String> {
|
||||
if let Some(orig) = original {
|
||||
let current = registry::load_system_paths()?;
|
||||
if current != orig {
|
||||
return Err("注册表已被其他进程修改,请重新加载后重试".to_string());
|
||||
}
|
||||
}
|
||||
registry::save_system_paths(paths)
|
||||
}
|
||||
#[tauri::command]
|
||||
pub fn save_user_paths(paths: Vec<String>) -> Result<(), String> {
|
||||
pub fn save_user_paths(paths: Vec<String>, original: Option<Vec<String>>) -> Result<(), String> {
|
||||
if let Some(orig) = original {
|
||||
let current = registry::load_user_paths()?;
|
||||
if current != orig {
|
||||
return Err("注册表已被其他进程修改,请重新加载后重试".to_string());
|
||||
}
|
||||
}
|
||||
registry::save_user_paths(paths)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user