diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index bf68b64..e3e756d 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -103,8 +103,6 @@ dependencies = [ "tauri-plugin-log", "tauri-plugin-opener", "tauri-plugin-shell", - "tauri-plugin-store", - "uuid", ] [[package]] @@ -4180,22 +4178,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tauri-plugin-store" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d85dd80d60a76ee2c2fdce09e9ef30877b239c2a6bb76e6d7d03708aa5f13a19" -dependencies = [ - "dunce", - "serde", - "serde_json", - "tauri", - "tauri-plugin", - "thiserror 2.0.16", - "tokio", - "tracing", -] - [[package]] name = "tauri-runtime" version = "2.8.0" @@ -4432,21 +4414,9 @@ dependencies = [ "pin-project-lite", "slab", "socket2", - "tokio-macros", "windows-sys 0.59.0", ] -[[package]] -name = "tokio-macros" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.106", -] - [[package]] name = "tokio-util" version = "0.7.16" diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 4a55cdf..80f06eb 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -23,8 +23,6 @@ serde = { version = "1.0", features = ["derive"] } log = "0.4" tauri = { version = "2.8.2", features = [] } tauri-plugin-log = "2" -tauri-plugin-store = "2" tauri-plugin-shell = "2" tauri-plugin-opener = "2" dirs = "5.0" -uuid = { version = "1.11", features = ["v4", "serde"] } diff --git a/src-tauri/capabilities/default.json b/src-tauri/capabilities/default.json index f140085..07c42de 100644 --- a/src-tauri/capabilities/default.json +++ b/src-tauri/capabilities/default.json @@ -8,7 +8,6 @@ "permissions": [ "core:default", "shell:allow-open", - "shell:allow-execute", "opener:default" ] -} \ No newline at end of file +} diff --git a/src-tauri/src/provider.rs b/src-tauri/src/provider.rs index 9e2127f..b27aeb7 100644 --- a/src-tauri/src/provider.rs +++ b/src-tauri/src/provider.rs @@ -2,7 +2,6 @@ use serde::{Deserialize, Serialize}; use serde_json::Value; use std::collections::HashMap; use std::path::Path; -use uuid::Uuid; use crate::config::{ copy_file, delete_file, get_provider_config_path, read_json_file, write_json_file, @@ -22,16 +21,6 @@ pub struct Provider { } impl Provider { - /// 创建新的供应商 - pub fn new(name: String, settings_config: Value, website_url: Option) -> Self { - Self { - id: Uuid::new_v4().to_string(), - name, - settings_config, - website_url, - } - } - /// 从现有ID创建供应商 pub fn with_id(id: String, name: String, settings_config: Value, website_url: Option) -> Self { Self { @@ -170,15 +159,6 @@ impl ProviderManager { Ok(()) } - /// 获取当前供应商 - pub fn get_current_provider(&self) -> Option<&Provider> { - if self.current.is_empty() { - None - } else { - self.providers.get(&self.current) - } - } - /// 获取所有供应商 pub fn get_all_providers(&self) -> &HashMap { &self.providers diff --git a/src-tauri/src/store.rs b/src-tauri/src/store.rs index 8a961ba..4f84131 100644 --- a/src-tauri/src/store.rs +++ b/src-tauri/src/store.rs @@ -31,15 +31,5 @@ impl AppState { manager.save_to_file(&config_path) } - /// 重新加载配置 - pub fn reload(&self) -> Result<(), String> { - let config_path = get_app_config_path(); - let new_manager = ProviderManager::load_from_file(&config_path)?; - - let mut manager = self.provider_manager.lock() - .map_err(|e| format!("获取锁失败: {}", e))?; - - *manager = new_manager; - Ok(()) - } -} \ No newline at end of file + // 保留按需扩展:若未来需要热加载,可在此实现 +}