feat: Integrate HTTP plugin and update IP detection to use fetch API #4712

This commit is contained in:
Tunglies
2025-09-18 19:35:14 +08:00
parent 409571f54b
commit 9d96ac0f6a
8 changed files with 71 additions and 67 deletions

31
src-tauri/Cargo.lock generated
View File

@@ -1149,6 +1149,7 @@ dependencies = [
"tauri-plugin-dialog",
"tauri-plugin-fs",
"tauri-plugin-global-shortcut",
"tauri-plugin-http",
"tauri-plugin-notification",
"tauri-plugin-process",
"tauri-plugin-shell",
@@ -1656,6 +1657,12 @@ dependencies = [
"parking_lot_core 0.9.11",
]
[[package]]
name = "data-url"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "be1e0bca6c3637f992fc1cc7cbc52a78c1ef6db076dbf1059c4323d6a2048376"
[[package]]
name = "deelevate"
version = "0.2.0"
@@ -7315,6 +7322,30 @@ dependencies = [
"thiserror 2.0.16",
]
[[package]]
name = "tauri-plugin-http"
version = "2.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "938a3d7051c9a82b431e3a0f3468f85715b3442b3c3a3913095e9fa509e2652c"
dependencies = [
"bytes",
"cookie_store",
"data-url",
"http 1.3.1",
"regex",
"reqwest",
"schemars 0.8.22",
"serde",
"serde_json",
"tauri",
"tauri-plugin",
"tauri-plugin-fs",
"thiserror 2.0.16",
"tokio",
"url",
"urlpattern",
]
[[package]]
name = "tauri-plugin-notification"
version = "2.3.1"

View File

@@ -83,6 +83,7 @@ isahc = { version = "1.7.2", default-features = false, features = [
"parking_lot",
] }
backoff = { version = "0.4.0", features = ["tokio"] }
tauri-plugin-http = "2"
[target.'cfg(windows)'.dependencies]

View File

@@ -18,6 +18,12 @@
"autostart:allow-disable",
"autostart:allow-is-enabled",
"core:window:allow-set-theme",
"notification:default"
"notification:default",
"http:default",
"http:allow-fetch",
{
"identifier": "http:default",
"allow": [{ "url": "https://*/*" }, { "url": "http://*/*" }]
}
]
}

View File

@@ -74,7 +74,8 @@ mod app_init {
.plugin(tauri_plugin_fs::init())
.plugin(tauri_plugin_dialog::init())
.plugin(tauri_plugin_shell::init())
.plugin(tauri_plugin_deep_link::init());
.plugin(tauri_plugin_deep_link::init())
.plugin(tauri_plugin_http::init());
#[cfg(all(debug_assertions, not(feature = "tokio-trace")))]
{