From 369424caefd4cb49f33264a7a874173478f651cc Mon Sep 17 00:00:00 2001 From: coso Date: Fri, 26 Dec 2025 01:56:49 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=B7=A8=E5=B9=B3?= =?UTF-8?q?=E5=8F=B0=E7=BC=96=E8=AF=91=E9=94=99=E8=AF=AF=20-=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=20macOS=20=E5=AD=98=E6=A0=B9=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加 set_macos_machine_id 的非 macOS 平台存根实现 - 添加 check_macos_admin 的非 macOS 平台存根实现 - 修复 E0599 编译错误:方法未找到 - 所有平台现在都能正确编译 - 遵循现有的条件编译模式 --- src-tauri/src/services/machine_id_service.rs | 23 ++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src-tauri/src/services/machine_id_service.rs b/src-tauri/src/services/machine_id_service.rs index c3fb11af1..f9772f904 100644 --- a/src-tauri/src/services/machine_id_service.rs +++ b/src-tauri/src/services/machine_id_service.rs @@ -491,6 +491,29 @@ impl MachineIdService { }) } + // === macOS 存根实现 (非 macOS 平台) === + + #[cfg(not(target_os = "macos"))] + async fn set_macos_machine_id(&self, _new_id: &str) -> Result { + Ok(MachineIdResult { + success: false, + message: "macOS machine ID modification not supported on this platform".to_string(), + requires_restart: false, + requires_admin: false, + new_machine_id: None, + }) + } + + #[cfg(not(target_os = "macos"))] + async fn check_macos_admin(&self) -> Result { + Ok(AdminStatus { + is_admin: false, + platform: "non-macOS".to_string(), + elevation_method: None, + check_success: false, + }) + } + // === Linux 特定实现 === #[cfg(target_os = "linux")]