fix(tauri): macOS 开发模式跳过 npc 内网穿透客户端(Linux/Windows 二进制在 mac 无法执行)

This commit is contained in:
Pine
2026-08-18 01:40:18 +08:00
parent a9a63986be
commit 2358d992c3
+7
View File
@@ -592,6 +592,13 @@ async fn sse_handler() -> Sse<impl Stream<Item = Result<Event, Infallible>>> {
/// 每次启动检查持久化目录(与 data.json 同一目录下的 npc/)中是否存在,
/// 不存在则从嵌入式 npc.zip 解压。
pub fn setup_npc() {
// 开发环境(macOS)跳过:嵌入的 npc 是 Linux/Windows 二进制,mac 上无法执行,
// 且开发机不需要内网穿透(npc 仅生产部署时把内网大屏机穿透到公网服务器)
if cfg!(target_os = "macos") {
println!("[dpm] macOS 开发模式:跳过内网穿透客户端(npc 仅 Windows 生产部署使用)");
return;
}
let data_dir = dirs::data_dir()
.unwrap_or_else(|| PathBuf::from("."))
.join("dpm")