From f22f0905ca64e5365bd38e97b83e6378dcde7cba Mon Sep 17 00:00:00 2001 From: Pine Date: Tue, 18 Aug 2026 01:38:01 +0800 Subject: [PATCH] =?UTF-8?q?feat(tauri):=20=E6=91=84=E5=83=8F=E5=A4=B4/?= =?UTF-8?q?=E9=BA=A6=E5=85=8B=E9=A3=8E=E6=9D=83=E9=99=90=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=EF=BC=88macOS=20=E6=8E=88=E6=9D=83=E4=B8=80=E6=AC=A1=20+=20Win?= =?UTF-8?q?dows=20=E5=85=BC=E5=AE=B9=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Info.plist:NSCameraUsageDescription / NSMicrophoneUsageDescription(授权一次后不再询问) - tauri.conf.json:macOSPrivateApi + WebView2 autoplay 允许(自动问候语音不被拦)+ nsis/app/dmg 双平台打包 - Cargo.toml:tauri 启用 macos-private-api feature --- src-tauri/Cargo.toml | 2 +- src-tauri/Info.plist | 12 ++++++++++++ src-tauri/tauri.conf.json | 9 +++++++-- 3 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 src-tauri/Info.plist diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 02b8ca1..1a3c7b2 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -13,7 +13,7 @@ crate-type = ["staticlib", "cdylib", "rlib"] tauri-build = { version = "2", features = [] } [dependencies] -tauri = { version = "2", features = [] } +tauri = { version = "2", features = ["macos-private-api"] } tauri-plugin-opener = "2" tauri-plugin-autostart = "2" serde = { version = "1", features = ["derive"] } diff --git a/src-tauri/Info.plist b/src-tauri/Info.plist new file mode 100644 index 0000000..422bb13 --- /dev/null +++ b/src-tauri/Info.plist @@ -0,0 +1,12 @@ + + + + + + NSCameraUsageDescription + 用于大屏前的摄像头实时识别(人脸检测、手势控制),画面仅在本机处理,不对外传输。 + + NSMicrophoneUsageDescription + 用于实时语音对话(语音识别与合成),音频仅在本机处理。 + + diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 81ce157..0e91190 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -10,12 +10,14 @@ "frontendDist": "../dist" }, "app": { + "macOSPrivateApi": true, "windows": [ { "title": "昆明大学生创业园展播系统", "width": 1200, "height": 800, - "fullscreen": true + "fullscreen": true, + "additionalBrowserArgs": "--autoplay-policy=no-user-gesture-required --enable-features=WebRtcHideLocalIpsWithMdns" } ], "security": { @@ -24,7 +26,10 @@ }, "bundle": { "active": true, - "targets": ["nsis"], + "targets": ["nsis", "app", "dmg"], + "macOS": { + "minimumSystemVersion": "10.15" + }, "icon": [ "icons/32x32.png", "icons/128x128.png",