fix: extern controler api secert with headers

This commit is contained in:
Tunglies
2025-03-05 07:59:16 +08:00
parent 4ed36f6223
commit 5760f16272
3 changed files with 12 additions and 11 deletions

View File

@@ -2,22 +2,17 @@ use super::CmdResult;
use crate::core;
use mihomo_api;
#[tauri::command]
pub async fn get_proxies() -> CmdResult<serde_json::Value> {
let (mihomo_server, _) = core::clash_api::clash_client_info().unwrap();
let mihomo = mihomo_api::MihomoManager::new(mihomo_server);
Ok(mihomo
.refresh_proxies()
.await
.unwrap()
.get_proxies())
let (mihomo_server, headers) = core::clash_api::clash_client_info().unwrap();
let mihomo = mihomo_api::MihomoManager::new(mihomo_server, headers);
Ok(mihomo.refresh_proxies().await.unwrap().get_proxies())
}
#[tauri::command]
pub async fn get_providers_proxies() -> CmdResult<serde_json::Value> {
let (mihomo_server, _) = core::clash_api::clash_client_info().unwrap();
let mihomo = mihomo_api::MihomoManager::new(mihomo_server);
let (mihomo_server, headers) = core::clash_api::clash_client_info().unwrap();
let mihomo = mihomo_api::MihomoManager::new(mihomo_server, headers);
Ok(mihomo
.refresh_providers_proxies()
.await