diff --git a/src-tauri/src/commands/config.rs b/src-tauri/src/commands/config.rs index b16fc28..a8b640c 100644 --- a/src-tauri/src/commands/config.rs +++ b/src-tauri/src/commands/config.rs @@ -1548,10 +1548,9 @@ pub async fn get_version_info() -> Result { } fn scan_cli_identity(cli_path: &std::path::Path) -> String { - let mut identity_path = cli_path.to_path_buf(); - #[cfg(target_os = "windows")] - { + let identity_path = { + let mut identity_path = cli_path.to_path_buf(); let file_name = cli_path .file_name() .and_then(|name| name.to_str()) @@ -1566,7 +1565,11 @@ fn scan_cli_identity(cli_path: &std::path::Path) -> String { identity_path = cmd_path; } } - } + identity_path + }; + + #[cfg(not(target_os = "windows"))] + let identity_path = cli_path.to_path_buf(); identity_path .canonicalize() diff --git a/src-tauri/src/commands/service.rs b/src-tauri/src/commands/service.rs index 30e1736..932dfe9 100644 --- a/src-tauri/src/commands/service.rs +++ b/src-tauri/src/commands/service.rs @@ -1593,6 +1593,7 @@ pub fn invalidate_cli_detection_cache() {} /// 跨平台统一的服务状态检测:纯 TCP 端口连通性(macOS/Linux 使用) #[cfg(not(target_os = "windows"))] +#[allow(dead_code)] fn check_tcp_service_status(_uid: u32, _label: &str) -> (bool, Option) { let port = crate::commands::gateway_listen_port(); let addr = format!("127.0.0.1:{port}");