refactor: invock mihomo api by use tauri-plugin-mihomo

This commit is contained in:
oomeow
2025-10-01 09:30:28 +08:00
parent f905969ed8
commit 64545de4b6
65 changed files with 1982 additions and 1840 deletions
+2 -2
View File
@@ -2,7 +2,7 @@
pub async fn set_public_dns(dns_server: String) {
use crate::{core::handle, utils::dirs};
use tauri_plugin_shell::ShellExt;
let app_handle = match handle::Handle::global().app_handle() {
let app_handle = match handle::Handle::app_handle() {
Some(handle) => handle,
None => {
log::error!(target: "app", "app_handle not available for DNS configuration");
@@ -50,7 +50,7 @@ pub async fn set_public_dns(dns_server: String) {
pub async fn restore_public_dns() {
use crate::{core::handle, utils::dirs};
use tauri_plugin_shell::ShellExt;
let app_handle = match handle::Handle::global().app_handle() {
let app_handle = match handle::Handle::app_handle() {
Some(handle) => handle,
None => {
log::error!(target: "app", "app_handle not available for DNS restoration");