refactor: service reinstallation logic on detection failure

This commit is contained in:
wonfen
2025-03-25 00:51:26 +08:00
parent b5b5ae4e7b
commit cf78bb3686
6 changed files with 292 additions and 15 deletions

View File

@@ -0,0 +1,8 @@
use super::CmdResult;
use crate::{core::CoreManager, wrap_err};
/// 修复系统服务
#[tauri::command]
pub async fn repair_service() -> CmdResult {
wrap_err!(CoreManager::global().repair_service().await)
}

View File

@@ -6,6 +6,7 @@ pub type CmdResult<T = ()> = Result<T, String>;
// Command modules
pub mod app;
pub mod clash;
pub mod core;
pub mod media_unlock_checker;
pub mod network;
pub mod profile;
@@ -22,6 +23,7 @@ pub mod lighteweight;
// Re-export all command functions for backwards compatibility
pub use app::*;
pub use clash::*;
pub use core::*;
pub use media_unlock_checker::*;
pub use network::*;
pub use profile::*;