mirror of
https://github.com/LHY0125/PathEditor.git
synced 2026-06-29 01:45:54 +08:00
feat: 导入改用原生对话框、新增 app-store 单元测试、修复窗口滚动
- handleImport 从 DOM <input> hack 改为 @tauri-apps/plugin-dialog 原生文件选择 - 新增 Rust read_text_file 命令读取文件内容,零外部依赖 - 新增 tests/unit/app-store.test.ts,25 个测试覆盖 CRUD/undo-redo/loadPaths/savePaths - 修复 AppShell overflow-hidden 导致无法滚动窗口的问题 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
/// 读取文本文件内容(供前端原生对话框选择文件后使用)
|
||||
#[tauri::command]
|
||||
pub fn read_text_file(path: &str) -> Result<String, String> {
|
||||
std::fs::read_to_string(path).map_err(|e| format!("无法读取文件: {}", e))
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
pub mod registry;
|
||||
pub mod system;
|
||||
pub mod backup;
|
||||
pub mod fs;
|
||||
|
||||
@@ -26,6 +26,7 @@ pub fn run() {
|
||||
commands::system::broadcast_env_change,
|
||||
commands::backup::backup_registry,
|
||||
commands::backup::get_appdata_dir,
|
||||
commands::fs::read_text_file,
|
||||
])
|
||||
.run(tauri::generate_context!())
|
||||
.expect("error while running tauri application");
|
||||
|
||||
Reference in New Issue
Block a user