From db8c240d95766808ca846669a4e4270188896c34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BB=9D=E5=B0=98?= <237809796@qq.com> Date: Fri, 2 Oct 2026 01:21:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=9F=E8=83=BD:=20=E5=90=AF=E7=94=A8=20Taur?= =?UTF-8?q?i=20asset=20=E5=8D=8F=E8=AE=AE=E6=94=AF=E6=8C=81=20webview=20?= =?UTF-8?q?=E6=9C=AC=E5=9C=B0=E5=9B=BE=E7=89=87=E9=A2=84=E8=A7=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Cargo.toml 开启 protocol-asset feature - tauri.conf.json 配置 assetProtocol scope=** - Cargo.lock 同步 http-range 依赖 --- Cargo.lock | 7 +++++++ src-tauri/Cargo.toml | 2 +- src-tauri/tauri.conf.json | 6 +++++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index aaed683..a785f9a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1973,6 +1973,12 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "http-range" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21dec9db110f5f872ed9699c3ecf50cf16f423502706ba5c72462e28d3157573" + [[package]] name = "httparse" version = "1.10.1" @@ -4524,6 +4530,7 @@ dependencies = [ "gtk", "heck 0.5.0", "http", + "http-range", "jni", "libc", "log", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index ce4de59..a55483a 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -14,7 +14,7 @@ tauri-build = { version = "2", features = [] } [dependencies] # Phase3 桌面内嵌 HTTP MCP server + 托盘常驻:tray-icon feature 非默认,必须显式启用 -tauri = { version = "2", features = ["tray-icon"] } +tauri = { version = "2", features = ["protocol-asset", "tray-icon"] } tauri-plugin-dialog = "2" tauri-plugin-opener = "2" tauri-plugin-window-state = "2" diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index e9db4f6..4b53308 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -20,7 +20,11 @@ } ], "security": { - "csp": null + "csp": null, + "assetProtocol": { + "enable": true, + "scope": ["**"] + } } }, "bundle": {